18.06.2013, 17:13
Hello guys could someone set this up for a timer for every 3 hours it can be robbed?
Код:
CMD:robpizza( playerid, params[ ] )
{
new string[128];
if ( pRobbingP[ playerid ] )
return SendClientMessage( playerid, COLOR_YELLOW, "ERROR:{FFFFFF} You are already robbing Fort Carson Pizza" );
if ( !IsPlayerInRangeOfPoint( playerid, 3.0, -235.861953,1082.324951,19.745937 ) )
return SendClientMessage( playerid, COLOR_YELLOW, "ERROR:{FFFFFF} You must be in the checkpoint at Fort Carson Pizza to use this command!" );
if ( pizzaRobbed )
return SendClientMessage( playerid, COLOR_YELLOW, "ERROR:{FFFFFF} Fort Carson Pizza has been robbed recently, please wait patiently!" );
robTimerP[ playerid ] = SetTimerEx( "robPizza", 30000, false, "i", playerid );
SendClientMessage( playerid, COLOR_YELLOW, "[ROBBERY INFO] You have started a robbery, it will last 30 seconds. Do not leave the checkpoint!" );
pRobbingP[ playerid ] = true;
pizzaRobbed = true;
new
szStr[ 128 ],
usrName[ 24 ];
format(string, sizeof(string), "DISPATCH:[Robbery] All units be advised we got a 207 at Pizza Stack");
format(string, sizeof(string), "DISPATCH:[Robbery] Location : West Street, Fort Carson");
SendFamilyMessage(4, COLOR_TWPINK, string);
SendFamilyMessage(18, COLOR_TWPINK, string);
GameTextForPlayer( playerid, "~g~Robbery in process~n~~r~Do not leave the checkpoint!", 30000, 3 );
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) +2);
return true;
}
public robPizza( playerid )
{
new
randMoney = random( 4000 );
GivePlayerMoney( playerid, randMoney );
new
szStr[ 128 ],
szStr1[128],
usrName[ 24 ];
format( szStr, 128, "[ROBBERY INFO] Robbery succesfull! You have earned $%d and 1 score from the robbery.", randMoney );
SendClientMessage( playerid, COLOR_YELLOW, szStr );
pRobbingP[ playerid ] = false;
SetTimer( "pizzaDelay", 90000, false );
format(szStr1, sizeof (szStr1), "~g~You have succesfuly robbed $%d from Fort Carson Pizza!", randMoney);
GameTextForPlayer( playerid, szStr1, 3000, 3 );
GivePlayerCash(playerid, 4000);
SetPlayerScore(playerid, GetPlayerScore(playerid) +1 );
}
forward pizzaDelay( );
public pizzaDelay( )
{
pizzaRobbed = false;
return true;
}

