PDA

View Full Version : Help with /aduty and /v


[DX]Aru12345
22/03/2013, 05:36 AM
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.

CBCandyBoy
22/03/2013, 05:50 AM
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");
}

dusk
22/03/2013, 07:26 AM
Why an enum? Ofcourse it works, but I suggest you using something like new bool:aduty[MAX_PLAYERS]

LarzI
22/03/2013, 08:20 AM
Why an enum? Ofcourse it works, but I suggest you using something like new bool:aduty[MAX_PLAYERS]

Or even better: Bit-flags http://forum.sa-mp.com/showthread.php?t=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.