04.09.2013, 08:08
I want when player type /duty ,to go on duty and when type /duty again to go off duty..Is there a way to do that ?
new Enabled[MAX_PLAYERS];
CMD:duty(playerid,params[])
{
if(Enabled[playerid] == 0)
{
Enabled[playerid] = 1;
SendClientMessage(playerid,-1,"You are on duty now!");
// rest of the code
return 0; // return 0, so the code will ignore the other lines, allowing you to go on duty.
}
if(Enabled[playerid] == 1)
{
Enabled[playerid] = 0;
SendClientMessage(playerid,-1,"You are now off duty!");
//rest of code
}
return 1;
}
I want when player type /duty ,to go on duty and when type /duty again to go off duty..Is there a way to do that ?
|
new AdminDuty[MAX_PLAYERS];
CMD:duty(playerid, params[]) { if(AdminDuty[playerid] == 0) { //whatever you want it to do when enabled AdminDuty[playerid] = 1; } else if(AdminDuty[playerid] == 1) { //whatever you want it to do when disabled AdminDuty[playerid] = 0; } return 1; }