SA-MP Forums Archive
Help with /aduty and /v - 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: Help with /aduty and /v (/showthread.php?tid=424418)



Help with /aduty and /v - [DX]Aru12345 - 22.03.2013

How to make a command /aduty that put admin on duty and how to make a /v command with model name or part of model name.


Re: Help with /aduty and /v - CBCandyBoy - 22.03.2013

u must first enum that like

Код:
enum ainfo {
        onduty
}
and then

under onplayerconnect

Код:
ainfo[playerid][onduty] = 0;
and under on player disconnet
Код:
ainfo[playerid][onduty] = 0;
and now start making command like

Код:
CMD:onduty(playerid,params[])
{
            if.........//here your level check command{
	    if(aInfo[playerid][OnDuty] == 0)
	    {
 			aInfo[playerid][OnDuty] = 1;
 			return SendClientMessage(playerid,0x00FFAA,"|- You are now in \"Duty Mode\" -|");
		}
		else
		{
			aInfo[playerid][OnDuty] = 0;
 			return SendClientMessage(playerid,0x00FFAA,"|- You are now in \"Playing Mode\"-|");
		}
	}
	return SendClientMessage(playerid, red, "You are not high enough to use this command");
}



Re: Help with /aduty and /v - dusk - 22.03.2013

Why an enum? Ofcourse it works, but I suggest you using something like
pawn Код:
new bool:aduty[MAX_PLAYERS]



Re: Help with /aduty and /v - LarzI - 22.03.2013

Quote:
Originally Posted by dusk
Посмотреть сообщение
Why an enum? Ofcourse it works, but I suggest you using something like
pawn Код:
new bool:aduty[MAX_PLAYERS]
Or even better: Bit-flags https://sampforum.blast.hk/showthread.php?tid=216730 (scroll down)

About /v [id/part of name]: This command has been made and given out 293874234 times before. A simple search in the Script Request thread will help you find it.