forward robBarber(playerid);
new robTimerB[ MAX_PLAYERS ], cp_Barber, bool: pRobbingB[ MAX_PLAYERS ], //Los Santos, Idlewood, Barber Shop bool: BarberRobbed;
Create3DTextLabel("/robbarber", COLOR_YELLOW, 413.265 , -17.957 , 1001.804, 40.0, 0, 0); cp_Barber = CreateDynamicCP(413.265 , -17.957 , 1001.804, 2.0, .interiorid = 2);
public robBarber(playerid) //Barber Shop LS { new randMoney = random(8000) + 1000; new szStr[ 128], usrName[24], string[128]; GetPlayerName( playerid, usrName, 24 ); format( szStr, 128, "%s has robbed $%d from the Barber Shop", usrName, randMoney ); SendClientMessageToAll( COLOR_ORANGERED, szStr ); format( szStr, 128, "{CC6600}[ROBBERY INFO] {FFFFFF}Robbery successful! You have earned {CC6600}$%d {FFFFFF}, Score Earned : {CC6600}1 ", randMoney ); SendClientMessage( playerid, COLOR_WHITE, szStr ); pRobbingB[ playerid ] = false; SetTimer( "barberDelay", 90000, false ); pInfo[playerid][Cash] += randMoney; pInfo[playerid][Score] += 1; pInfo[playerid][Robs] += 1; format(string, 128, "{CC6600}[ROBBERY INFO] {FFFFFF}Your robbing skill has increased to {CC6600}%d", pInfo[playerid][Robs]); SendClientMessage(playerid, COLOR_WHITE, string); new color = GetPlayerColor(playerid); if(color == COLOR_WHITE) return SetPlayerColor(playerid, COLOR_ORANGE); else if(color == COLOR_ORANGE) return SetPlayerColor(playerid, COLOR_RED); return 1; }
if (pRobbingB[playerid]) { if (checkpointid == cp_Barber) { pRobbingB[playerid] = false; KillTimer(robTimerB[playerid]); BarberRobbed = false; GameTextForPlayer(playerid, "~r~You have failed the robbery!", 1000, 3); } }
forward barberDelay( ); public barberDelay( ) { BarberRobbed = false; return true;
CMD:robbarber(playerid, params[]) //Barber Shop, Idlewood { if (pRobbingB[ playerid ]) return SendClientMessage( playerid, COLOR_RED, "ERROR:{FFFFFF} You are already robbing Idlewood Barber Shop" ); if (!IsPlayerInRangeOfPoint( playerid, 3.0, 413.265 , -17.957 , 1001.804 ) ) return SendClientMessage( playerid, COLOR_RED, "ERROR:{FFFFFF} You must be in the checkpoint at Idlewood Barber Shop to use this command!" ); if (BarberRobbed ) return SendClientMessage( playerid, COLOR_WHITE, "{CC6600}Idlewood Barber Shop {FFFFFF}has been {CC6600}robbed recently." ); 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; }
Wait Wait, i dont understand. can i just drag the Commands data over to the OnPlayerEnterDynamicCP
|
Example
if(pRobbingB[playerid]) { 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; } }
Код:
if(pRobbingB[playerid]) { 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; } } |