if(strcmp(cmdtext,"/jetpack",true) == 0) { if(PlayerInfo[playerid][pAdmin] == 3 || PlayerInfo[playerid][pAdmin] == 4 || PlayerInfo[playerid][pAdmin] == 5 || PlayerInfo[playerid][pAdmin] == 6 || PlayerInfo[playerid][pAdmin] == 1337 || PlayerInfo[playerid][pAdmin] == 1338 ) { new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid,X,Y,Z); SetPlayerPos(playerid, X, Y, Z); SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK); SendClientMessage(playerid, COLOR_GREY, "* You Have Spawned A Jetpack"); } else { SendClientMessage(playerid, 0xAA0000AA, "You Are Not Authorized To Use This Command!"); } return 1; }
CMD:jetpack(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
if( sscanf( params, "u", params[0] ) )
{
SetPlayerSpecialAction(playerid, 2);
}
else
{
SetPlayerSpecialAction(params[0], 2);
SendClientMessageEx(params[0] , COLOR_BLUE ," admin %s you gave a jetpack" , Name(playerid) );
}
} else return SendClientMessage(playerid, COLOR_RED , "you are not an administrator with sufficient level to use this command");
return 1;
}
if(strcmp(cmd, "/jetpack", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new tmp[256], forplayerid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SetPlayerSpecialAction(playerid, 2);
return 1;
}
forplayerid = strval(tmp);
SetPlayerSpecialAction(forplayerid, 2);
}
return 1;
}
if(strcmp("/jetpack", cmdtext, true) == 0)
{
new tmp[128];
tmp = strtok(cmdtext, idx);
SetPlayerSpecialAction(strval(tmp), 2);
return 1;
}
C:\Users\Andrew\Desktop\GTA Server iRealLife\iRealLife\gamemodes\larp.pwn(24489) : warning 219: local variable "tmp" shadows a variable at a preceding level |
if(strcmp("/jetpack", cmdtext, true) == 0)
{
tmp = strtok(cmdtext, idx);
SetPlayerSpecialAction(strval(tmp), 2);
return 1;
}