17.01.2017, 16:26
Quote:
Here is your code finished, though in future most people won't be as nice to do it for you. I hope you learn from what I have done, and actually apply it in the future.
Код:
CMD:robbery(playerid, params[]) { if(!IsPlayerInDynamicCP(playerid, CP_Warehouse)) return SendClientMessage(playerid, COLOR_RED,"You are not in a Warehouse Checkpoint!!"); { if(Warehouserobbedrecently >=1) //checking if WArehouse has been robbed recently { SendClientMessage(playerid, COLOR_RED, "[ROBBERY]: Warehouse has been robbed recently"); // sending error message } new can_rob ; can_rob = random( 100 ); switch( can_rob ) { case 0 .. 49: // successful robbery { ROBBING_Warehouse[playerid] = 60; // setting the robbery timer SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) +5); Warehouserobbedrecently = 200; // Time the players needs to wait for starting an another robbery in the same place return 1; } default: { // send error message } } } return 1; } |