/aduty command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /aduty command (
/showthread.php?tid=373428)
locked - [COD5]DarKnight - 30.08.2012
.......
Re: /aduty command -
[HK]Ryder[AN] - 30.08.2012
Which command processor are you using?
Re: /aduty command -
Marven - 30.08.2012
here is what you need i think. If there is some mistake dont blame me iam a bit sleepy atm. :P
pawn Код:
// put this at the top of script
new OnDuty[MAX_PLAYERS];
//The cmd is using ZCMD.
CMD:aduty(playerid,params[])
{
// if the player isnt a rcon admin then this message will be sent to him.
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Invalid Command.");
if(OnDuty[playerid] == 0)
{
SetPlayerSkin(playerid,217);
SetPlayerHealth(playerid,100000);
SetPlayerColor(playerid, 0x01FCFFFF);
OnDuty[playerid] = 1;
}
else
{
SetPlayerSkin(playerid,23);
SetPlayerHealth(playerid,100);
SetPlayerColor(playerid 0xFFFFFFFF);
OnDuty[playerid] = 0;
}
return 1;
}
didnt tested it hopefully it will work.
Re: /aduty command -
TaLhA XIV - 30.08.2012
I edited Marven's codes to a better one:
PHP код:
// put this at the top of script
new OnDuty[MAX_PLAYERS];
//The cmd is using ZCMD.
CMD: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)) return SendClientMessage(playerid,-1,"Invalid Command.");
if(OnDuty[playerid] == 0)
{
SetPlayerSkin(playerid,217);
SetPlayerHealth(playerid,100000);
SetPlayerColor(playerid, 0x01FCFFFF);
OnDuty[playerid] = 1;
}
else
{
SetPlayerSkin(playerid,skin);
SetPlayerHealth(playerid,100);
SetPlayerColor(playerid 0xFFFFFFFF);
OnDuty[playerid] = 0;
}
return 1;
}
There you go.