16.06.2014, 13:53
Adding to what Abagail said you should also indent because the final command shouldn't look like:
It should look like this with the proper indentation and with abagail's adjustment:
pawn Code:
CMD:sethp(playerid,params[])
{
if(IsPlayerAdmin(playerid))
{
new Float:Health;
new PID;
if(sscanf(params, "ud", PID, Health)) return SendClientMessage(playerid, -1, "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;
}
pawn Code:
CMD:sethp(playerid,params[])
{
if(IsPlayerAdmin(playerid))
{
new Float:Health;
new PID;
if(sscanf(params, "ud", PID, Health)) return SendClientMessage(playerid, -1, "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;
}