30.09.2010, 16:12
I tired to allow this command only after a check if the player is an Admin, but it doesn't work, I can use it without being an Admin, plus if ID is wrong it doesn't show anything.
PHP код:
CMD:slap(playerid, params[])
{
if (IsPlayerAdmin(playerid))
SendClientMessage(playerid, 0xFF4646FF, "You are not authorized to use that command !");
new otherId;
if(sscanf(params, "u", otherId)) return SendClientMessage(playerid, 0xFF4646FF, "USAGE: /slap [ID/PartOfname]");
if(otherId != INVALID_PLAYER_ID)
{
new message[40];
new Float:slx, Float:sly, Float:slz;
GetPlayerPos(otherId, slx, sly, slz);
SetPlayerPos(otherId, slx, sly, slz+5);
PlayerPlaySound(otherId, 1130, slx, sly, slz+5);
format(message, sizeof(message), "(( You have been slapped by admin ! ))");
SendClientMessage(playerid, 0xFFFFFFAA, message);
}
return 1;
}