// Steal The Cashbox GM 0.1 // Coded by Chiarboss // ©2007 // Dont edit code or part of it without my permission // To get permission contact: marco.chiarelli@hotmail.it #include #pragma tabsize 0 #define SLOTS 28 enum SavePlayerPosEnum { Float:LastX, Float:LastY, Float:LastZ } enum PlayerSpawnInfo { Float:PlayerX, Float:PlayerY, Float:PlayerZ, Float:PlayerAngle } new playerColors[100] = { 0xFF8C13FF,0xC715FFFF,0x20B2AAFF,0xDC143CFF,0x6495EDFF,0xf0e68cFF,0x778899FF,0xFF1493FF,0xF4A460FF,0xEE82EEFF,0xFFD720FF, 0x8b4513FF,0x4949A0FF,0x148b8bFF,0x14ff7fFF,0x556b2fFF,0x0FD9FAFF,0x10DC29FF,0x534081FF,0x0495CDFF,0xEF6CE8FF,0xBD34DAFF, 0x247C1BFF,0x0C8E5DFF,0x635B03FF,0xCB7ED3FF,0x65ADEBFF,0x5C1ACCFF,0xF2F853FF,0x11F891FF,0x7B39AAFF,0x53EB10FF,0x54137DFF, 0x275222FF,0xF09F5BFF,0x3D0A4FFF,0x22F767FF,0xD63034FF,0x9A6980FF,0xDFB935FF,0x3793FAFF,0x90239DFF,0xE9AB2FFF,0xAF2FF3FF, 0x057F94FF,0xB98519FF,0x388EEAFF,0x028151FF,0xA55043FF,0x0DE018FF,0x93AB1CFF,0x95BAF0FF,0x369976FF,0x18F71FFF,0x4B8987FF, 0x491B9EFF,0x829DC7FF,0xBCE635FF,0xCEA6DFFF,0x20D4ADFF,0x2D74FDFF,0x3C1C0DFF,0x12D6D4FF,0x48C000FF,0x2A51E2FF,0xE3AC12FF, 0xFC42A8FF,0x2FC827FF,0x1A30BFFF,0xB740C2FF,0x42ACF5FF,0x2FD9DEFF,0xFAFB71FF,0x05D1CDFF,0xC471BDFF,0x94436EFF,0xC1F7ECFF, 0xCE79EEFF,0xBD1EF2FF,0x93B7E4FF,0x3214AAFF,0x184D3BFF,0xAE4B99FF,0x7E49D7FF,0x4C436EFF,0xFA24CCFF,0xCE76BEFF,0xA04E0AFF, 0x9F945CFF,0xDCDE3DFF,0x10C9C5FF,0x70524DFF,0x0BE472FF,0x8A2CD7FF,0x6152C2FF,0xCF72A9FF,0xE59338FF,0xEEDC2DFF,0xD8C762FF, 0x3FE65CFF }; new Float:gRandomSpawnsLV[][3] = { {1958.3783,1343.1572,15.3746}, {2199.6531,1393.3678,10.8203}, {2483.5977,1222.0825,10.8203}, {2637.2712,1129.2743,11.1797}, {2000.0106,1521.1111,17.0625}, {2024.8190,1917.9425,12.3386}, {2261.9048,2035.9547,10.8203}, {2262.0986,2398.6572,10.8203}, {2244.2566,2523.7280,10.8203}, {2335.3228,2786.4478,10.8203}, {2150.0186,2734.2297,11.1763}, {2158.0811,2797.5488,10.8203}, {1969.8301,2722.8564,10.8203}, {1652.0555,2709.4072,10.8265}, {1564.0052,2756.9463,10.8203}, {1271.5452,2554.0227,10.8203}, {1441.5894,2567.9099,10.8203}, {1480.6473,2213.5718,11.0234}, {1400.5906,2225.6960,11.0234}, {1598.8419,2221.5676,11.0625}, {1318.7759,1251.3580,10.8203}, {1558.0731,1007.8292,10.8125}, //{-857.0551,1536.6832,22.5870}, Out of Town Spawns //{817.3494,856.5039,12.7891}, //{116.9315,1110.1823,13.6094}, //{-18.8529,1176.0159,19.5634}, //{-315.0575,1774.0636,43.6406}, {1705.2347,1025.6808,10.8203} }; new Float:gRandomSpawnsSF[][3] = { {-2062.5583,237.4662,35.7149}, {-2653.6443,1388.2767,7.1301}, {-2642.2583,-274.9985,7.5393}, {-2157.2119,649.5484,52.3672}, {-1377.4271,466.0897,7.1875}, {-1754.9976,958.5851,24.8828}, {-2665.4282,635.6348,14.4531}, {-1635.0077,665.8105,7.1875} }; new Float:gRandomSpawnsLS[][3] = { {2495.2207,-1687.3169,13.5152}, {832.2958,-1080.4476,24.2969}, {2459.0442,-949.4450,80.0800}, {1761.7893,-1892.7225,13.5551}, {1552.5618,-1675.3375,16.1953}, {1648.0593,-1246.5391,14.8125}, {978.7343,-676.4680,121.9763}, {1130.1899,-2037.6155,69.0078}, {1124.1123,-1102.4474,24.9679}, {2674.3682,-2015.3687,13.5560} }; new gDelay[] = {25050000,350000,4500032,25000000,35000,14000,32000}; new randDELAY; new Float:xdeath,Float:ydeath,Float:zdeath; #define CHECKPOINT_PICKUP 1 #define CHECKPOINT_DROPOFF 2 //colori #define COLOR_GREY 0xAFAFAFAA #define COLOR_WHITE 0xFFFFFFAA #define COLOR_GREEN 0x33AA33AA #define COLOR_YELLOW 0xFFFF00AA #define COLOR_BLUE 0x1111AAFF #define COLOR_PINK 0xFF66FFAA #define COLOR_LIGHTBLUE 0x33CCFFAA #define COLOR_DARKRED 0x660000AA #define COLOR_ORANGE 0xFF9900AA #define COLOR_RED 0xAA3333AA #define COLOR_INVIS 0xAFAFAFFF #define TEAM_GROVE_COLOR 0x00D900C8 #define NICE_BLUE 0xa0d3ffAA //------------------------------------------------------------------------- new delay[MAX_PLAYERS],rand=0; new round,timeview=1,cash=1,cashcheck[MAX_PLAYERS]=0,givecash=0; new consecutive[MAX_PLAYERS]; new HighestScore; new HighestScorers[MAX_PLAYERS]; new st=0; new tk[MAX_PLAYERS],antikill=1,gRoundTimer=0,Float:support[MAX_PLAYERS]=1.0,gRoundTimerEx=0,lockex[MAX_PLAYERS]=0,lock=1; new briefing[MAX_PLAYERS]=1,color[MAX_PLAYERS],briefingex=1,piduser=2,pidadmin=20,clock[MAX_PLAYERS]=1,clockex=1; new Text:Time; new taked[MAX_PLAYERS],death=0; new DMTime,DMTimeEx,gPlayerCheckpointStatus=1,colorex[MAX_PLAYERS]; //------------------------------------------------------------------------- forward CheckScore(); forward GameModeExitFunc(); forward DMTimer(); forward MoneyGrubScoreUpdate(); forward ExitLauncherConfigCash(); forward StopPlaySound(playerid);forward SetPlayerFlash(playerid); //------------------------------------------------------------------------- main() { print("\nLoaded Steal The Cashbox GM 0.1\n"); } //------------------------------------------------------------------------- public OnGameModeInit() { UsePlayerPedAnims(); DMTime=pidadmin*60; SetGameModeText("Steal The Cashbox GM 0.1"); gRoundTimer = SetTimer("DMTimer", 900, 1); ShowPlayerMarkers(1); ShowNameTags(1); SetTeamCount(0); round=random(3); SetupForRound(); for (new id=209; id<=253; id++) AddPlayerClass(id,0.0,0.0,0.0,0.0,0,0,0,0,0,0); return 1; } //------------------------------------------------------------------------- stock SetupPlayerForClassSelection(playerid) { SetPlayerInterior(playerid,3); SetPlayerPos(playerid,-2654.4,1424.2,912.4); SetPlayerFacingAngle(playerid, 90.0); SetPlayerCameraPos(playerid,-2654.4-1.5,1424.2,912.4+0.7); SetPlayerCameraLookAt(playerid,-2654.4,1424.2,912.4+0.7); ApplyAnimation(playerid,"DANCING","dnce_M_d",4.0,1,0,0,0,-1); return; } //------------------------------------------------------------------------- public OnPlayerRequestClass(playerid) { SetupPlayerForClassSelection(playerid); return 1; } //------------------------------------------------------------------------- public OnPlayerRequestSpawn(playerid) { ClearAnimations(playerid); PlayerPlaySound(playerid,1057,0,0,0); return 1; } //------------------------------------------------------------------------- stock SetupForRound() { randDELAY=random(sizeof(gDelay)); SetupForStringEx(); for(new i=0;i 0)SendClientMessage(i,COLOR_RED,string); }else{ if(newstate==PLAYER_STATE_DRIVER&&lock==1)SendClientMessage(playerid, COLOR_YELLOW, "<> Type /lock to lock, unlock the doors. <>"); } return 1; } //------------------------------------------------------------------------- public OnPlayerSpawn(playerid) {SetPlayerInterior(playerid,0); new randSPAWN=0;TogglePlayerClock(playerid,1);consecutive[playerid]=0; switch(round){ case 0:{randSPAWN=random(sizeof(gRandomSpawnsLV)); SetPlayerPos(playerid,gRandomSpawnsLV[randSPAWN][0],gRandomSpawnsLV[randSPAWN][1],gRandomSpawnsLV[randSPAWN][2]);} case 1:{randSPAWN=random(sizeof(gRandomSpawnsSF)); SetPlayerPos(playerid,gRandomSpawnsSF[randSPAWN][0],gRandomSpawnsSF[randSPAWN][1],gRandomSpawnsSF[randSPAWN][2]);} case 2:{randSPAWN=random(sizeof(gRandomSpawnsLS)); SetPlayerPos(playerid,gRandomSpawnsLS[randSPAWN][0],gRandomSpawnsLS[randSPAWN][1],gRandomSpawnsLS[randSPAWN][2]);} } DisablePlayerCheckpoint(playerid); GameTextForPlayer(playerid,"~n~~r~Go ~w~to steal ~y~the cashbox!",3000,3); GivePlayerWeapon(playerid,24,300);GivePlayerWeapon(playerid,29,1000);GivePlayerWeapon(playerid,31,1000); if(death == 1){ SetPlayerCheckpoint(playerid,xdeath,ydeath,zdeath,1.0);}else{SetupForCheckpoints(playerid);} delay[playerid]=0;taked[playerid]=0; return 1; } //------------------------------------------------------------------------- public OnPlayerDeath(playerid, killerid, reason) { new string[256],name[MAX_PLAYER_NAME];GetPlayerName(playerid,name,sizeof(name)); if(taked[playerid]==1){SetupForStringEx();} if(taked[killerid]==1){delay[killerid]+=2500;} SetupForCashboxDropped(playerid); GivePlayerMoney(killerid,delay[killerid]); GivePlayerMoney(playerid,-delay[killerid]); if(killerid == INVALID_PLAYER_ID) { SendDeathMessage(INVALID_PLAYER_ID,playerid,reason); } else { // Valid kill consecutive[killerid]++; st++; GetPlayerName(killerid,name, sizeof(name)); SetPlayerScore(killerid, GetPlayerScore(killerid) + 1); if(st != 1 && consecutive[killerid] != 5 && consecutive[killerid] !=6 && consecutive[killerid] !=7 && consecutive[killerid] !=8) { GameTextForPlayer(playerid, "~n~You got pwn3d!", 1000, 1); } else if(st == 1) { format(string, sizeof(string), "~y~%s ~w~made the first kill! +3 kills to him!",name); SetPlayerScore(killerid, GetPlayerScore(killerid) + 2); GameTextForAll(string, 6000, 6); } else if(consecutive[killerid] == 5) { format(string, sizeof(string), "~y~%s ~w~is rockin' out!",name); GameTextForAll(string, 6000, 6); } else if(consecutive[killerid] == 6) { format(string, sizeof(string), "OMG! ~y~%s ~w~is pwning you all!",name); GameTextForAll(string, 6000, 6); } else if(consecutive[killerid] == 7) { format(string, sizeof(string), "WOW! ~y~%s ~w~is an omicide fury!",name); GameTextForAll(string, 6000, 6); } else if(consecutive[killerid] >= 8) { format(string, sizeof(string), "~y~%s~w~: the king of the server... 0.0",name); GameTextForAll(string, 6000, 6); } if(taked[killerid]==1){ format(string,sizeof(string),"~n~~g~%d",delay[killerid]); } SendDeathMessage(killerid,playerid,reason); SetPlayerScore(killerid,GetPlayerScore(killerid)+1); GivePlayerMoney(killerid,1000);GivePlayerMoney(playerid,-1150); if(antikill!=1){GameTextForPlayer(killerid,string,2000,1);} if(antikill==1 && taked[playerid] == 0){ SendClientMessage(killerid, COLOR_RED, "No teamkilling! Be careful the next time!"); SendDeathMessage(killerid,playerid,reason); SetPlayerScore(killerid,GetPlayerScore(killerid)-1); GivePlayerMoney(killerid,-2000); new Float:x,Float:y,Float:z; GetPlayerPos(playerid, x, y, z); z = 1000; SetPlayerPos(killerid,x,y,z);tk[killerid] ++; if(tk[killerid] == 2) { SendClientMessage(killerid, COLOR_RED, "Once again and you will be kicked!"); } if(tk[killerid] >= 3) { GetPlayerName(killerid,name, sizeof(name)); printf(" -A.T.K Script-: %s kicked for teamkilling",name); Kick(killerid); format(string, sizeof(string), "The AntiTeamkill system kicked %s for teamkilling!",name); SendClientMessageToAll(COLOR_GREEN, string); } } SendDeathMessage(killerid,playerid,reason); SetPlayerScore(killerid,GetPlayerScore(killerid)+1); GivePlayerMoney(killerid,1000);GivePlayerMoney(playerid,-1150); } return 1; } //------------------------------------------------------------------------- stock SetupForCashboxDropped(playerid){new name[MAX_PLAYER_NAME],string[256];GetPlayerName(playerid,name,sizeof(name)); if(taked[playerid]==1){KillTimer(gRoundTimerEx);gPlayerCheckpointStatus=1;format(string,sizeof(string),"%s Just Dropped the Cashbox containing %d$",name,gDelay);GetPlayerPos(playerid,xdeath,ydeath,zdeath);for(new i=0;i HighestScore){ for (new i=0; i 0){ HighestScorers[numberscorers]=playerid; numberscorers++; } score=0; } } } return numberscorers; } //------------------------------------------------------------------------- //In the routine where you make the call for the highest score: public CheckScore(){ new numberscorers=CheckPlayerScore(); //not sure if the () should be attached new giveplayername[MAX_PLAYER_NAME]; new string[256]; for (new i=0; i 0){ for (new i=0; i 0 && playermoney >= moneys) { GivePlayerMoney(playerid, (0 - moneys)); GivePlayerMoney(giveplayerid, moneys); format(string, sizeof(string), "You have sent %s(player: %d), $%d.", giveplayer,giveplayerid, moneys); SendClientMessage(playerid, 0xFF8A00AA, string); format(string, sizeof(string), "You have recieved $%d from %s(player: %d).", moneys, sendername, playerid); SendClientMessage(giveplayerid, 0xFF8A00AA, string); printf("%s(playerid:%d) has transfered %d to %s(playerid:%d)",sendername, playerid, moneys, giveplayer, giveplayerid); } else { SendClientMessage(playerid, COLOR_RED, "Invalid transaction amount."); } } else { format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_RED, string); } }else{SendClientMessage(playerid,COLOR_RED,"The GiveCash system is currently disabled.");} return 1; } if(strcmp(cmd,"/givecashlock",true)==0) { if(IsPlayerAdmin(playerid)) { new name[MAX_PLAYER_NAME];GetPlayerName(playerid,name,sizeof(name)); if(givecash==0){format(string,sizeof(string),"The Admin %s has enabled the Clock Function.",name);givecash=1;}else{ givecash=0;format(string,sizeof(string),"The Admin %s has disabled the Clock Function.",name);}SendClientMessageToAll(0xFF8A00AA,string); }else{SendClientMessage(playerid,COLOR_RED,"You arent admin!!!");} return 1; } return 0; } stock ResetAdvise(string[],roundex) {round=roundex;SetupForStringEx();SendClientMessageToAll(0xFF8A00AA,string);for(new i=0;i ' ') && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result; } //------------------------------------------------------------------------- public MoneyGrubScoreUpdate() { new CashScore; new name[MAX_PLAYER_NAME]; //new string[256]; for(new i=0; i CashScoreOld) { CashScoreOld = CashScore; //format(string, sizeof(string), "$$$ %s is now in the lead $$$", name); //SendClientMessageToAll(COLOR_YELLOW, string); }*/ } } } //------------------------------------------------------------------------- public GameModeExitFunc() { for (new i=0; i