07.10.2010, 22:46
Oh, something else to add.
pawn Код:
CMD:goto(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 1) // Wrong way :)
{
return SendClientMessage(playerid, 0xFF4646FF, "You are not authorized to use that command !");
}
else
{
new pID,
otherId,
string[256];
if(!IsPlayerConnected(pID))
return SendClientMessage(playerid, COLOR_RED, "* Invalid player ID!");
{ // ???????
if(sscanf(params, "rii", otherId)) // Useless parameter? lol
return SendClientMessage(playerid, 0xAFAFAFAA, "Usage: /goto [PlayerID/PartOfName]");
format(string, sizeof(string), "* You have successfully teleported your self",playerid);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
new Float:x, Float:y, Float:z;
GetPlayerPos(otherId, x, y, z);
SetPlayerPos(playerid, x+1, y, z);
} // ???????
}
return 1;
}