COMMAND:portloc(playerid, params[])
{
// Setup local variables
new Float:x, Float:y, Float:z, PortMsg[128],interior;
// Send the command to all admins so they can see it
SendAdminText(playerid, "/portloc", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player's admin-level is at least 1
if (APlayerData[playerid][PlayerLevel] >= 1)
{
// Check if the player has a wanted level of less than 3
if (GetPlayerWantedLevel(playerid) < 3)
{
// Check if the player is not jailed
if (APlayerData[playerid][PlayerJailed] == 0)
{
if (sscanf(params, "fffi", x, y, z , interior)) SendClientMessage(playerid, 0xFF0000AA, "Ex: \"/portloc <x> <y> <z> <int>"");
else
{
// Port the player to the given location
SetPlayerPos(playerid, x, y, z);
SetPlayerInterior(playerid,interior);
// Let the player know about it
format(PortMsg, 128, "Te-ai teleportat la locatia: %4.2f, %4.2f, %4.2f", x, y, z);
SendClientMessage(playerid, 0x00FF00FF, PortMsg);
}
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nu poti utiliza /portloc at cand esti in inchisoare");
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nu poti utiliza /portloc at cand esti urmarit");
}
else
return 0;
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}