{ //Now, we will be needing a user variable for the Player ID, and a Integer variable for the amount.
new player, health, string[128], administrator[MAX_PLAYER_NAME];
if(!sscanf(params, "ui", player, health))
{
if(player != INVALID_PLAYER_ID)
{
if(SInfo[playerid][pAdmin] >= 0)
{
GetPlayerName(playerid, administrator, sizeof(administrator));
SetPlayerHealth(player, health);
format(string, sizeof(string), "[ADMIN]: Player ID %d's HP has been set to %d by %s.", player, health, administrator);
SendClientMessageToAll(0xDEEE20FF, string);
AChat(ADMIN, string, 1); //Broadcasts a message to every administrator.
printf(string);
}
else return SendClientMessage(playerid, ROJO, "[Command not found on GTACNR , use /cmds or /commands to see it ]"); //If you're not an Administrator it will send you this client message.
}
else return SendClientMessage(playerid, ROJO, "[ERROR]: That user ID is not connected."); //If you enteROJO an INVALID_PLAYER_ID, it will send you this client message.
}
else return SendClientMessage(playerid, CELESTE, "[USAGE]: /SetHP [Player ID/Part of Name] [Amount]"); //If you enteROJO the wrong syntax, it will send you this, telling you the exact syntax.
return 1; //Always include a return 1; after the syntax, or you will get "SERVER: Unknown Command."
}
if(strcmp("/sethp 100", cmdtext, true)) { SetPlayerHealth(playerid, 100); SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just set your HP to 100"); SendClientMessageToAll(playerid, 0xAFAFAFAA "(MESSAGE) Has just set their HP to 100!"); return 1; } |
C:\Users\Jonesy\Desktop\SA-MP scripting\gamemodes\bare.pwn(45) : error 035: argument type mismatch (argument 2) C:\Users\Jonesy\Desktop\SA-MP scripting\gamemodes\bare.pwn(45) : warning 215: expression has no effect C:\Users\Jonesy\Desktop\SA-MP scripting\gamemodes\bare.pwn(45) : error 001: expected token: ";", but found ")" C:\Users\Jonesy\Desktop\SA-MP scripting\gamemodes\bare.pwn(45) : error 029: invalid expression, assumed zero C:\Users\Jonesy\Desktop\SA-MP scripting\gamemodes\bare.pwn(45) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |
if(strcmp("/sethp 100", cmdtext, true))
{
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just set your HP to 100.");
format(string, sizeof(string), "(MESSAGE) %s Has just set his health to 100.");
SendClientMessageToAll(0xAFAFAFAA, string);
return 1;
}
C:\Users\Jonesy\Desktop\SA-MP scripting\gamemodes\bare.pwn(45) : error 017: undefined symbol "string" C:\Users\Jonesy\Desktop\SA-MP scripting\gamemodes\bare.pwn(45) : error 017: undefined symbol "string" C:\Users\Jonesy\Desktop\SA-MP scripting\gamemodes\bare.pwn(45) : error 029: invalid expression, assumed zero C:\Users\Jonesy\Desktop\SA-MP scripting\gamemodes\bare.pwn(45) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |
if(strcmp("/sethp 100", cmdtext, true)) { SetPlayerHealth(playerid, 100); SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just set your HP to 100."); format(string, sizeof(string), "(MESSAGE) %s Has just set his health to 100."); SendClientMessageToAll(0xAFAFAFAA, string); return 1; } |