18.07.2010, 05:06
Guys, when I tried to create a command, and when I compile it, it doesn't show any errors, then when I play in the game, the command doesn't work. help me please
CMD:help(playerid,params[])
{
SendClientMessage(playerid,YOURCOLORHERE,"Welcome To The Server. Please Follow This Rules:");
SendClientMessage(playerid,YOURCOLORHERE,"No Cheating, Don't Rage At People ^.^");
return 1;
}
CMD:health(playerid,params[])
{
new PID,pHealth,Msg[128];
if(sscanf(params,"dd",PID,pHealth)) return SendClientMessage(playerid,YOURCOLORHERE,"USAGE: /Health < PlayerID > < Ammount >");
if(!IsPlayerConnected(PID)) return SendClientMessage(playerid,YOURCOLORHERE,"That User Is Not Online"); // Sending message of an invalid player.
new name[MAX_PLAYER_NAME];
GetPlayerName(PID,name,sizeof(name));
format(Msg,sizeof(Msg),"You have given %s ( %d ammount of health )",name,pHealth);
SendClientMessage(playerid,YOURCOLORHERE,Msg);
SetPlayerHealth(PID,pHealth);
return 1;
}
}