28.03.2017, 20:10
Hello so basically i'm a newbie in scripting i tried making these 2 simple cmd's, but it doesn't work for a reason. When i try to test it on my ID, it says Player is not connected.
Here is the codes for /sethp cmd:
And codes for /setarmour cmd:
I get the same result for both CMD's, so i'm sure that i made something wrong but i cant find what is it...
Here is the codes for /sethp cmd:
Код:
CMD:sethp(playerid,params[]) { if(PlayerInfo[playerid][pAdmin]>1337) { new Float:Health; new PID; if(sscanf(params, "ud", PID, Health)) return SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /sethp [playerid] [health]"); if(!IsPlayerConnected(PID)) return SendClientMessage(playerid, -1, "Player is not connected."); SetPlayerHealth(PID, Health); } else SendClientMessage(playerid, -1, "You are not authorized to use this command!"); return 1; }
Код:
CMD:setarmour(playerid,params[]) { if(PlayerInfo[playerid][pAdmin]>1337) { new float:Armour; new PID; if(sscanf(params,"ud",PID,Armour)) return SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /setarmour [playerid] [armor]"); if(!IsPlayerConnected(PID)) return SendClientMessage(playerid,COLOR_GRAD1,"Player is not connected."); SetPlayerArmour(playerid, Armour); } else SendClientMessage(playerid,-1,"You are not authorized to use this command!"); return 1; }