12.09.2018, 15:35
If player is admin, he types /aduty he will get the skin and minigun and health, armour but also he will get Error Unknown command!....
And when he types again /aduty he is not off duty, nothing happens except he also gets minigun, armour, health and skin 217.
I think there is something missing and that's what if player is not an admin.
On top of the script i have:
And when he types again /aduty he is not off duty, nothing happens except he also gets minigun, armour, health and skin 217.
I think there is something missing and that's what if player is not an admin.
On top of the script i have:
PHP код:
new OnDuty[MAX_PLAYERS];
PHP код:
dcmd_aduty(playerid,params[])
{
new skin = GetPlayerSkin(playerid);
// if the player isnt a rcon admin then this message will be sent to him.
if(!IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdminLevel] > 0)
SendClientMessage(playerid, COLOR_ERROR, "Unknown Command! Type /cmds For Available Commands.");
if(OnDuty[playerid] == 0)
{
SetPlayerSkin(playerid,217);
SetPlayerHealth(playerid,9999);
SetPlayerArmour(playerid,9999);
GivePlayerWeapon(playerid,38,9999);
OnDuty[playerid] = 1;
}
else
{
SetPlayerSkin(playerid,skin);
SetPlayerHealth(playerid,100);
OnDuty[playerid] = 0;
}
return 1;
}