31.08.2011, 02:44
First of all, why do you specify a length in strcmp? It seems a little odd considering it doesn't do anything in this circumstance.
Secondly, how do you want to check for administrator? Do you want to use the standard RCON administrator stuff? If so, then use IsPlayerAdmin, for example:
You can read more about IsPlayerAdmin on the SA-MP Wiki:
https://sampwiki.blast.hk/wiki/IsPlayerAdmin
Edit: grr, stop posting so fast!
Secondly, how do you want to check for administrator? Do you want to use the standard RCON administrator stuff? If so, then use IsPlayerAdmin, for example:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/heal", cmdtext, true) == 0)
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You need to be RCON admin!"); // Check if the player is not an RCON admin and stop execution with a client message
SetPlayerHealth(playerid,100);// heal the player
SendClientMessage(playerid, COLOR_YELLOW, "FT Bot: "#COL_GREEN"You have been healed!");
return 1;
}
return 0;
}
https://sampwiki.blast.hk/wiki/IsPlayerAdmin
Edit: grr, stop posting so fast!