Could you help me to make a command to enable/disable the rob able instead of the "waittumer" like /enablerob
Thank you.
PHP код:
//Command(s)
CMD:robbank(playerid, params[])
{
if(robpossible == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 2309.1899,-8.4444,26.7422))
{
robpossible = 0;
SetTimer("waittimer", 300000, false); //Normal Mode 5 minutes
//SetTimer("waittimer", 65000, false); //Test Mode 65 seconds
SetTimer("robtimer", 60000, false);
SendClientMessage(playerid, COLOR_WHITE, "You are robbing the bank, the police has been notified!");
SendClientMessage(playerid, COLOR_WHITE, "You gotta stay 30 seconds in the bank in order to rob it!");
}
} else {
SendClientMessage(playerid, COLOR_WHITE, "You can't rob the bank right now!");
}
return 1;
}
PHP код:
CMD:robbank(playerid, params[])
{
if(robpossible == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 2309.1899,-8.4444,26.7422))
{
robpossible = 0;
SetTimer("waittimer", 300000, false); //Normal Mode 5 minutes
//SetTimer("waittimer", 65000, false); //Test Mode 65 seconds
SetTimer("robtimer", 60000, false);
SendClientMessage(playerid, COLOR_WHITE, "You are robbing the bank, the police has been notified!");
SendClientMessage(playerid, COLOR_WHITE, "You gotta stay 30 seconds in the bank in order to rob it!");
}
else
return SendClientMessage(playerid, COLOR_WHITE, "You have to be near the rob-point to start robbing.");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You can't rob the bank right now!");
}
return 1;
}
CMD:togglerob(playerid, params[])
{
if(Check if this guy is Admin) //Eg: pInfo[playerid][Admin] > 4
{
new msgx[128]
if(robpossible == 0)
{
format(msgx, sizeof(msgx), "%s has enabled bank robing. Use /robbank at the bank to start robbing.", PlayerName(playerid));
robpossible = 1;
}
else
{
format(msgx, sizeof(msgx), "%s has disabled bank robing.", PlayerName(playerid));
robpossible = 0;
}
return SendClientMessageToAll(COLOR_IMPORTANT, msgx);
}
return SendClientMessage(playerid, COLOR_WHITE, "You are not authorized to use this command.");
}