[HELP]Robbery system : Commands and checkpoints
#2

if(checkpointid == cp_Barber)
{
robTimerB[ playerid ] = SetTimerEx( "robBarber", 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!" );

pRobbingB[ playerid ] = true;
BarberRobbed = true;

// format( szStr, 128, "[ROBBERY] %s has began a robbery at Idlewood Pizza!", GetName(playerid) );
// SendClientMessageToAll( COLOR_ORANGERED, szStr );

GameTextForPlayer( playerid, "~g~Robbery in process~n~~r~Do not leave the checkpoint!", 32000, 3 );
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) +2);
return 1;
}

That's all you have to do. Then add the opposite to OnPlayerLeaveDynamicCP. Also it would be more efficient to create a custom function like RobBarber(playerid) and place the command code under there.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)