23.02.2014, 19:29
Also a tip:
If you're gonna add admin check, add it above
new int, Float, Float:y, Float:z;
so variables aren't created uselessly if player isn't admin.
like this:
pawn Код:
CMD:gotoco(playerid, params[])
{
new int, Float:x, Float:y, Float:z;
// You can add your admin code here like "if(PlayerInfo[playerid][pAdmin]..."
if(sscanf(params, "fffi", x,y,z, int)) return SendClientMessage(playerid, -1, "USAGE: /gotoco [x] [y] [z] [interior]");
SetPlayerPos(playerid, x,y,z);
SetPlayerInterior(playerid, int);
return 1;
}
new int, Float, Float:y, Float:z;
so variables aren't created uselessly if player isn't admin.
like this:
pawn Код:
CMD:gotoco(playerid, params[])
{
if(!IsPlayerAdmin) return SendClientMessage(playerid, 0xFF0000AA, "You need to be an admin to use this command.");
new int, Float:x, Float:y, Float:z;
if(sscanf(params, "fffi", x,y,z, int)) return SendClientMessage(playerid, -1, "USAGE: /gotoco [x] [y] [z] [interior]");
SetPlayerPos(playerid, x,y,z);
SetPlayerInterior(playerid, int);
return 1;
}