07.10.2010, 22:38
I started using zcmd and the other feature forgot the name, I came up with this:
Now, I just want to ask, what is the problem with my code ? every player can use it, while not being an admin, even though I defined everything.
Now, I just want to ask, what is the problem with my code ? every player can use it, while not being an admin, even though I defined everything.
pawn Код:
CMD:goto(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 1){return SendClientMessage(playerid, 0xFF4646FF, "You are not authorized to use that command !");
}else
{
new pID;
new otherId;
new string[256];
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "* Invalid player ID!");
{
if(sscanf(params, "rii", otherId)) 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;
}