16.07.2014, 01:27
I invite you to have a look at the tutorial section, look for commands + sscanf tutorials.
I'll give you an example:
I'll give you an example:
pawn Code:
CMD:setcolor(playerid, params[])
{
new id, colour;
if (IsPlayerAdmin(playerid))
SendClientMessage(playerid, -1, "SERVER: Unknown command.");
else if (sscanf(params, "ud", id, colour))
SendClientMessage(playerid, -1, "USAGE: /setcolor [ player id ] [ colour ]");
else if (id == INVALID_PLAYER_ID)
SendClientMessage(playerid, -1, "Requested player was not found!");
else
{
SetPlayerColor(id, colour);
SendClientMessage(playerid, COLOR_GREEN, "You succesfully changed the player's colour.");
}
return 1;
}