Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- //#define FILTERSCRIPT
- //Scripted by Sufyan & Akhil..
- #include <a_samp>
- new Stats[MAX_PLAYERS];
- new Position;
- #define purple 0x800080AA
- #define COLOR_RED 0xFF0000AA
- #define RED "{F81414}"
- #define LIGHTBLUE "{00C0FF}"
- #define LRED "{FFA1A1}"
- #define GREEN "{6EF83C}"
- #define GREY "{C3C3C3}"
- #define GM2 2
- new GameMinutes =2;
- new GameSeconds =59;
- new GameTimer;
- new Text:Textdraw0;
- new Text:Textdraw5;
- forward GameTime(playerid);
- forward One(playerid);
- forward Two(playerid);
- forward Three(playerid);
- forward Four(playerid);
- forward Five(playerid);
- forward GoGoGo(playerid);
- //
- new iCountdown = 4;
- new iStartCountdown;
- new bool: iTimeToExit;
- new iTimerToExit;
- new Text:Textdraw1;new Text:Textdraw2;
- forward GameOver(playerid);
- forward iTimerToStartCountdown ( ) ;
- forward iStartRace ( ) ;
- forward iExitGameMode (playerid) ;
- forward iStartRace ( ) ;
- new bool: iRaceIsStarted ;
- #pragma tabsize 0
- new B[60];
- #define TOP5 false
- new
- Text: text_Top5[2]
- ;
- enum rankingEnum
- {
- player_Score,
- player_ID
- }
- main()
- {
- print("\n----------------------------------");
- print(" Alloy Wheels Of Steel \n GM No: 2 \n Date Created: 6/5/2011");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- SetTimer("BlueTeam",178000,0);
- UsePlayerPedAnims();
- for(new i;i<15;++i)
- {
- SendClientMessageToAll(purple," ");
- }
- // Don't use these lines if it's a filterscript
- SetGameModeText("Alloy Wheels Of Steel");
- AddPlayerClass(73, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- //TextDraw
- GameTimer = SetTimer("GameTime",1000,1);
- // Count1 = SetTimer("Time",1000,1);
- Textdraw0 = TextDrawCreate(586.000000, 43.000000,"3:00");
- TextDrawAlignment(Textdraw0,2);
- TextDrawBackgroundColor(Textdraw0,0x000000ff);
- TextDrawFont(Textdraw0,3);
- TextDrawLetterSize(Textdraw0,0.499999,2.000000);
- TextDrawColor(Textdraw0,0xffffffff);
- TextDrawSetOutline(Textdraw0,1);
- TextDrawSetProportional(Textdraw0,1);
- TextDrawSetShadow(Textdraw0,1);
- Textdraw5 = TextDrawCreate(306.000000, 114.000000, " ");
- TextDrawBackgroundColor(Textdraw5, 255);
- TextDrawFont(Textdraw5, 2);
- TextDrawLetterSize(Textdraw5, 1.290000, 7.700000);
- TextDrawColor(Textdraw5, -1);
- TextDrawSetOutline(Textdraw5, 0);
- TextDrawSetProportional(Textdraw5, 0);
- TextDrawSetShadow(Textdraw5, 1);
- SetTimer("StartGame",1,0);
- text_Top5[0] = TextDrawCreate(79.000000, 135.000000, "Top 5");
- TextDrawAlignment(text_Top5[0], 2);
- TextDrawBackgroundColor(text_Top5[0], 255);
- TextDrawFont(text_Top5[0], 1);
- TextDrawLetterSize(text_Top5[0], 0.280000, 1.499999);
- TextDrawColor(text_Top5[0], -1);
- TextDrawSetOutline(text_Top5[0], 0);
- TextDrawSetProportional(text_Top5[0], 1);
- TextDrawSetShadow(text_Top5[0], 0);
- text_Top5[1] = TextDrawCreate(16.000000, 135.000000, " ");
- TextDrawBackgroundColor(text_Top5[1], 255);
- TextDrawFont(text_Top5[1], 1);
- TextDrawLetterSize(text_Top5[1], 0.200000, 0.999999);
- TextDrawColor(text_Top5[1], -1);
- TextDrawSetOutline(text_Top5[1], 0);
- TextDrawSetProportional(text_Top5[1], 1);
- TextDrawSetShadow(text_Top5[1], 0);
- TextDrawUseBox(text_Top5[1], 1);
- TextDrawBoxColor(text_Top5[1], 150);
- TextDrawTextSize(text_Top5[1], 143.000000, 20.000000);
- SetTimer("GameOver",180000,false);
- //
- SetTimer ( "iTimerToStartCountdown" , 10000 , true ) ;
- if ( iTimeToExit == true ) {
- iTimerToExit = SetTimer ( "iExitGameMode" , 180000 , true ) ;
- iTimerToExit = false ;
- }
- //Vehicles
- B[0] = AddStaticVehicle(463,-1122.76806641,1099.78759766,37.70999527,138.00000000,-1,-1); //Freeway
- B[1] = AddStaticVehicle(463,-1123.81933594,1100.51110840,37.70817184,137.99926758,-1,-1); //Freeway
- B[2] = AddStaticVehicle(463,-1124.82678223,1101.29309082,37.71192551,137.99926758,-1,-1); //Freeway
- B[3] = AddStaticVehicle(463,-1125.68176270,1102.10302734,37.71203613,137.99926758,-1,-1); //Freeway
- B[4] = AddStaticVehicle(463,-1126.47692871,1103.00073242,37.71692276,137.99926758,-1,-1); //Freeway
- B[5] = AddStaticVehicle(463,-1127.39294434,1103.50695801,37.72463226,137.99926758,-1,-1); //Freeway
- B[6] = AddStaticVehicle(463,-1128.12927246,1104.32885742,37.72211838,137.99926758,-1,-1); //Freeway
- B[7] = AddStaticVehicle(463,-1128.97009277,1105.03344727,37.72415543,137.99926758,-1,-1); //Freeway
- B[8] = AddStaticVehicle(463,-1129.84228516,1105.81628418,37.72518158,137.99926758,-1,-1); //Freeway
- B[9] = AddStaticVehicle(463,-1134.35205078,1109.77416992,37.72369766,137.99926758,-1,-1); //Freeway
- B[10] = AddStaticVehicle(463,-1135.09960938,1110.30078125,37.72683716,137.99926758,-1,-1); //Freeway
- B[11] = AddStaticVehicle(463,-1135.83166504,1111.01599121,37.72648239,137.99926758,-1,-1); //Freeway
- B[12] = AddStaticVehicle(463,-1136.56811523,1111.73486328,37.72613525,137.99926758,-1,-1); //Freeway
- B[13] = AddStaticVehicle(463,-1137.28076172,1112.46032715,37.72516251,137.99926758,-1,-1); //Freeway
- B[14] = AddStaticVehicle(463,-1138.08618164,1113.19995117,37.73755264,137.99926758,-1,-1); //Freeway
- B[15] = AddStaticVehicle(463,-1138.97180176,1113.96594238,37.73932266,137.99926758,-1,-1); //Freeway
- B[16] = AddStaticVehicle(463,-1139.88903809,1114.63232422,37.73188400,137.99926758,-1,-1); //Freeway
- B[17] = AddStaticVehicle(463,-1140.75561523,1115.38208008,37.73352432,137.99926758,-1,-1); //Freeway
- B[18] = AddStaticVehicle(463,-1141.89880371,1116.17529297,37.73984146,137.99926758,-1,-1); //Freeway
- B[19] = AddStaticVehicle(463,-1120.37792969,1102.60485840,37.60331726,137.99926758,-1,-1); //Freeway
- B[20] = AddStaticVehicle(463,-1121.36303711,1103.39318848,37.59843063,137.99926758,-1,-1); //Freeway
- B[21] = AddStaticVehicle(463,-1122.38562012,1104.14404297,37.60314178,137.99926758,-1,-1); //Freeway
- B[22] = AddStaticVehicle(463,-1123.17810059,1104.86840820,37.60379791,137.99926758,-1,-1); //Freeway
- B[23] = AddStaticVehicle(463,-1123.98852539,1105.69812012,37.61041641,137.99926758,-1,-1); //Freeway
- B[24] = AddStaticVehicle(463,-1125.07739258,1106.42395020,37.61697769,137.99926758,-1,-1); //Freeway
- B[25] = AddStaticVehicle(463,-1126.03796387,1107.20471191,37.61981964,137.99926758,-1,-1); //Freeway
- B[26] = AddStaticVehicle(463,-1127.08886719,1107.81726074,37.62800217,137.99926758,-1,-1); //Freeway
- B[27] = AddStaticVehicle(463,-1128.13281250,1108.51574707,37.64270401,137.99926758,-1,-1); //Freeway
- B[28] = AddStaticVehicle(463,-1132.37731934,1111.84167480,37.63898849,137.99926758,-1,-1); //Freeway
- B[29] = AddStaticVehicle(463,-1133.12463379,1112.54113770,37.63978577,137.99926758,-1,-1); //Freeway
- B[30] = AddStaticVehicle(463,-1133.98608398,1113.20532227,37.64253616,137.99926758,-1,-1); //Freeway
- B[31] = AddStaticVehicle(463,-1134.78430176,1113.88073730,37.64436722,137.99926758,-1,-1); //Freeway
- B[32] = AddStaticVehicle(463,-1135.60278320,1114.54187012,37.64691162,137.99926758,-1,-1); //Freeway
- B[33] = AddStaticVehicle(463,-1136.40258789,1115.37341309,37.64545822,137.99926758,-1,-1); //Freeway
- B[34] = AddStaticVehicle(463,-1137.31958008,1116.30322266,37.64428711,137.99926758,-1,-1); //Freeway
- B[35] = AddStaticVehicle(463,-1138.33374023,1117.11572266,37.64758301,137.99926758,-1,-1); //Freeway
- B[36] = AddStaticVehicle(463,-1139.15002441,1117.69287109,37.65186691,137.99926758,-1,-1); //Freeway
- B[37] = AddStaticVehicle(463,-1139.91760254,1118.54602051,37.64841843,137.99926758,-1,-1); //Freeway
- B[38] = AddStaticVehicle(463,-1140.85131836,1119.22021484,37.65206909,137.99926758,-1,-1); //Freeway
- B[39] = AddStaticVehicle(463,-1143.03820801,1116.99584961,37.74423599,137.99926758,-1,-1); //Freeway
- B[40] = AddStaticVehicle(463,-1118.51025391,1104.81396484,37.51979446,137.99926758,-1,-1); //Freeway
- B[41] = AddStaticVehicle(463,-1119.57885742,1105.79321289,37.51936340,137.99926758,-1,-1); //Freeway
- B[42] = AddStaticVehicle(463,-1120.60327148,1106.79443359,37.51176834,137.99926758,-1,-1); //Freeway
- B[43] = AddStaticVehicle(463,-1121.78955078,1107.63439941,37.51788330,137.99926758,-1,-1); //Freeway
- B[44] = AddStaticVehicle(463,-1122.79357910,1108.74316406,37.52251816,137.99926758,-1,-1); //Freeway
- B[45] = AddStaticVehicle(463,-1124.07226562,1109.70764160,37.52786636,137.99926758,-1,-1); //Freeway
- B[46] = AddStaticVehicle(463,-1125.43945312,1110.83374023,37.53478622,137.99926758,-1,-1); //Freeway
- B[47] = AddStaticVehicle(463,-1130.13793945,1114.44213867,37.54105759,137.99926758,-1,-1); //Freeway
- B[48] = AddStaticVehicle(463,-1131.23901367,1115.32543945,37.54327011,137.99926758,-1,-1); //Freeway
- B[49] = AddStaticVehicle(463,-1132.35986328,1116.26672363,37.54451370,137.99926758,-1,-1); //Freeway
- B[50] = AddStaticVehicle(463,-1133.64172363,1117.44860840,37.54538345,137.99926758,-1,-1); //Freeway
- B[51] = AddStaticVehicle(463,-1134.89270020,1118.55883789,37.54715347,137.99926758,-1,-1); //Freeway
- B[52] = AddStaticVehicle(463,-1136.19348145,1119.51025391,37.55330276,137.99926758,-1,-1); //Freeway
- B[53] = AddStaticVehicle(463,-1137.33703613,1120.42651367,37.55601883,137.99926758,-1,-1); //Freeway
- B[54] = AddStaticVehicle(463,-1138.51257324,1121.45642090,37.55663681,137.99926758,-1,-1); //Freeway
- CreateObject(16061,-1079.14648438,1174.96044922,37.26702499,0.00000000,0.00000000,58.00000000); //object(des_treeline2)(2)
- CreateObject(1074,-1123.27001953,1095.54089355,37.88275146,0.00000000,0.00000000,136.00000000); //object(wheel_sr3)(1)
- CreateObject(1074,-1122.34045410,1096.74597168,37.83177185,0.00000000,0.00000000,135.99975586); //object(wheel_sr3)(2)
- CreateObject(1074,-1121.50988770,1097.78454590,37.79056931,0.00000000,0.00000000,135.99975586); //object(wheel_sr3)(3)
- CreateObject(1074,-1120.72363281,1098.68859863,37.75334549,0.00000000,0.00000000,135.99975586); //object(wheel_sr3)(4)
- CreateObject(1074,-1119.92407227,1099.44995117,37.71903992,0.00000000,0.00000000,135.99975586); //object(wheel_sr3)(5)
- CreateObject(1074,-1119.02453613,1100.41674805,37.67797089,0.00000000,0.00000000,135.99975586); //object(wheel_sr3)(6)
- CreateObject(1074,-1118.17187500,1101.52246094,37.63478470,0.00000000,0.00000000,135.99975586); //object(wheel_sr3)(7)
- CreateObject(1074,-1117.27746582,1102.51367188,37.59327316,0.00000000,0.00000000,135.99975586); //object(wheel_sr3)(8)
- CreateObject(1074,-1116.35620117,1103.55126953,37.55014038,0.00000000,0.00000000,135.99975586); //object(wheel_sr3)(9)
- CreateObject(1074,-1145.32238770,1116.91870117,37.87223816,0.00000000,0.00000000,323.99975586); //object(wheel_sr3)(10)
- CreateObject(1074,-1144.89416504,1117.52526855,37.84626770,0.00000000,0.00000000,323.99780273); //object(wheel_sr3)(11)
- CreateObject(1074,-1145.08605957,1123.54650879,37.95278168,0.00000000,0.00000000,323.99780273); //object(wheel_sr3)(12)
- CreateObject(1074,-1146.32373047,1122.28344727,38.21734619,0.00000000,0.00000000,323.99780273); //object(wheel_sr3)(13)
- CreateObject(1074,-1148.01269531,1120.55969238,38.15547180,0.00000000,0.00000000,323.99780273); //object(wheel_sr3)(14)
- CreateObject(1074,-1141.88916016,1126.79797363,37.66928864,0.00000000,0.00000000,323.99780273); //object(wheel_sr3)(15)
- CreateObject(1074,-1143.74377441,1124.90527344,37.64550781,0.00000000,0.00000000,323.99780273); //object(wheel_sr3)(16)
- CreateObject(1074,-1144.67077637,1120.09143066,37.78042984,0.00000000,0.00000000,323.99780273); //object(wheel_sr3)(17)
- return 1;
- }
- public OnGameModeExit()
- {
- TextDrawDestroy(text_Top5[0]);
- TextDrawDestroy(text_Top5[1]);
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerInterior(playerid,11);
- SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
- SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
- SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);
- SetPlayerFacingAngle(playerid,0.0);
- return 1;
- }
- forward BlueTeam();
- public BlueTeam( )
- {
- GameTextForAll("~g~Race Time ~r~Has Passed!!",2500,3);
- SetTimer("GameModeExitFunc",2000,0);
- }
- //---------------------------------
- public OnPlayerConnect(playerid)
- {
- GameTextForPlayer(playerid,"~w~Alloy~y~ Wheels ~n~~r~Of ~w~Steel~b~!",3000,1);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new veh;
- veh = GetPlayerVehicleID(playerid);
- SetVehicleToRespawn(veh);
- //kujh mat kar k
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SetPlayerRaceCheckpoint(playerid,0,-1206.5160,1024.8600,42.3262 ,-1303.3438,921.5903,45.9751,10);
- Stats[playerid] = 1;
- SetCameraBehindPlayer(playerid);
- if ( iRaceIsStarted == true ) {
- TogglePlayerControllable ( playerid , 1 ) ;
- GameTextForPlayer ( playerid , "The race has started.. ~r~you are late!" , 3000 , 3 ) ;
- }
- else {
- TogglePlayerControllable ( playerid , 0 ) ;
- }
- SetPlayerPos(playerid,-1125.76806641,1099.78759766,37.70999527);
- SetPlayerColor(playerid,purple);
- // TextDrawShowForPlayer(playerid, text_Top5[0]);
- // TextDrawShowForPlayer(playerid, text_Top5[1]);
- //Put Player In Vehicles
- if(playerid == 0)
- {
- PutPlayerInVehicle(playerid, B[0], 0);
- }
- else if(playerid == 1)
- {
- PutPlayerInVehicle(playerid, B[1], 0);
- }
- else if(playerid == 2)
- {
- PutPlayerInVehicle(playerid, B[2], 0);
- }
- else if(playerid == 3)
- {
- PutPlayerInVehicle(playerid, B[3], 0);
- }
- else if(playerid == 4)
- {
- PutPlayerInVehicle(playerid, B[4], 0);
- }
- else if(playerid == 5)
- {
- PutPlayerInVehicle(playerid, B[5], 0);
- }
- else if(playerid == 6)
- {
- PutPlayerInVehicle(playerid, B[6], 0);
- }
- else if(playerid == 7)
- {
- PutPlayerInVehicle(playerid, B[7], 0);
- }
- else if(playerid == 8)
- {
- PutPlayerInVehicle(playerid, B[8], 0);
- }
- else if(playerid == 9)
- {
- PutPlayerInVehicle(playerid, B[9], 0);
- }
- else if(playerid == 10)
- {
- PutPlayerInVehicle(playerid, B[10], 0);
- }
- else if(playerid == 11)
- {
- PutPlayerInVehicle(playerid, B[11], 0);
- }
- else if(playerid == 12)
- {
- PutPlayerInVehicle(playerid, B[12], 0);
- }
- else if(playerid == 13)
- {
- PutPlayerInVehicle(playerid, B[13], 0);
- }
- else if(playerid == 14)
- {
- PutPlayerInVehicle(playerid, B[14], 0);
- }
- else if(playerid == 15)
- {
- PutPlayerInVehicle(playerid, B[15], 0);
- }
- else if(playerid == 16)
- {
- PutPlayerInVehicle(playerid, B[16], 0);
- }
- else if(playerid == 17)
- {
- PutPlayerInVehicle(playerid, B[17], 0);
- }
- else if(playerid == 18)
- {
- PutPlayerInVehicle(playerid, B[18], 0);
- }
- else if(playerid == 19)
- {
- PutPlayerInVehicle(playerid, B[19], 0);
- }
- else if(playerid == 20)
- {
- PutPlayerInVehicle(playerid, B[20], 0);
- }
- else if(playerid == 21)
- {
- PutPlayerInVehicle(playerid, B[22], 0);
- }
- else if(playerid == 23)
- {
- PutPlayerInVehicle(playerid, B[23], 0);
- }
- else if(playerid == 24)
- {
- PutPlayerInVehicle(playerid, B[24], 0);
- }
- else if(playerid == 25)
- {
- PutPlayerInVehicle(playerid, B[25], 0);
- }
- else if(playerid == 26)
- {
- PutPlayerInVehicle(playerid, B[26], 0);
- }
- else if(playerid == 27)
- {
- PutPlayerInVehicle(playerid, B[27], 0);
- }
- else if(playerid == 28)
- {
- PutPlayerInVehicle(playerid, B[28], 0);
- }
- else if(playerid == 29)
- {
- PutPlayerInVehicle(playerid, B[29], 0);
- }
- else if(playerid == 30)
- {
- PutPlayerInVehicle(playerid, B[30], 0);
- }
- else if(playerid == 31)
- {
- PutPlayerInVehicle(playerid, B[31], 0);
- }
- else if(playerid == 32)
- {
- PutPlayerInVehicle(playerid, B[32], 0);
- }
- else if(playerid == 33)
- {
- PutPlayerInVehicle(playerid, B[33], 0);
- }
- else if(playerid == 34)
- {
- PutPlayerInVehicle(playerid, B[35], 0);
- }
- else if(playerid == 36)
- {
- PutPlayerInVehicle(playerid, B[36], 0);
- }
- else if(playerid == 37)
- {
- PutPlayerInVehicle(playerid, B[37], 0);
- }
- else if(playerid == 38)
- {
- PutPlayerInVehicle(playerid, B[38], 0);
- }
- else if(playerid == 39)
- {
- PutPlayerInVehicle(playerid, B[39], 0);
- }
- else if(playerid == 40)
- {
- PutPlayerInVehicle(playerid, B[40], 0);
- }
- else if(playerid == 41)
- {
- PutPlayerInVehicle(playerid, B[41], 0);
- }
- TextDrawShowForPlayer(playerid,Textdraw0);
- TextDrawShowForPlayer(playerid,Textdraw1);
- TextDrawShowForPlayer(playerid,Textdraw2);
- SetPlayerInterior(playerid,0);
- return 1;
- }
- forward StartGame(playerid);
- public StartGame(playerid)
- {
- SetTimer("Count",10000,0);
- return 1;
- }
- //
- public GameTime()
- {
- if(GameSeconds || GameMinutes)
- {
- GameSeconds--;
- if(GameSeconds <= -1)
- {
- GameMinutes--;
- GameSeconds=59;
- }
- new TimeString[14];
- format(TimeString,sizeof(TimeString),"%02d:%02d",GameMinutes,GameSeconds);
- TextDrawSetString(Textdraw0,TimeString);
- }
- return 1;
- }
- //
- public
- iTimerToStartCountdown ( ) {
- iStartCountdown = SetTimer ( "iStartRace" , 1000 , true ) ;
- //TextDrawShowForAll(Textdraw5);
- return 1;
- }
- public iExitGameMode (playerid) {
- KillTimer ( iTimerToExit ) ;
- for(new i;i<15;++i)
- {
- SendClientMessageToAll(purple," ");
- }
- SendClientMessageToAll(purple,"Please Donate For Our Server");
- }
- public iStartRace ( ) {
- iCountdown-- ;
- switch ( iCountdown ) {
- case 0: {
- GameTextForAll ( "~g~Go ~r~Go ~y~Go" , 1000 , 3 ) ;
- TextDrawHideForAll(Textdraw5);
- iTimeToExit = true ;
- KillTimer ( iStartCountdown ) ;
- iRaceIsStarted = true ;
- for ( new i = 0 ; i < MAX_PLAYERS ; i++ ) {
- TogglePlayerControllable ( i , true ) ;
- }
- }
- case 1: {
- GameTextForAll ( "1" , 1000 , 3 ) ;
- //TextDrawSetString(Textdraw5,"~g~1");
- //TextDrawSetString(Textdraw5,"~g~GO ~w~!!");
- }
- case 2: {
- GameTextForAll ( "2" , 1000 , 3 ) ;
- // TextDrawSetString(Textdraw5,"~y~2");
- //TextDrawSetString(Textdraw5,"~g~1");
- }
- case 3: {
- GameTextForAll ( "3" , 1000 , 3 ) ;
- //TextDrawSetString(Textdraw5,"~r~3");
- //TextDrawSetString(Textdraw5,"~y~2");
- }
- //case 4: {
- //TextDrawSetString(Textdraw5,"~r~3");
- // }
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- new veh;
- veh = GetPlayerVehicleID(playerid);
- SetVehicleToRespawn(veh);
- SendDeathMessage(killerid, playerid, reason);
- TextDrawHideForPlayer(playerid, text_Top5[0]);
- TextDrawHideForPlayer(playerid, text_Top5[1]);
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp(cmdtext, "/shop", true))
- {
- SendClientMessage(playerid,0xff0010ff,"***Shop Disabled in This Mission***");
- return 1;
- }
- return SendClientMessage(playerid,COLOR_RED,"Unknown Command Use /help For All Commands");
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- new veh;
- veh = GetPlayerVehicleID(playerid);
- SetVehicleToRespawn(veh);
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- switch(Stats[playerid])
- {
- case 1:
- {
- DisablePlayerRaceCheckpoint(playerid);
- PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
- SetPlayerRaceCheckpoint(playerid,0,-1303.3438,921.5903,45.9751 ,-1438.0826,778.1960,46.9262,10);
- Stats[playerid] = 2;
- return 1;
- }
- case 2:
- {
- DisablePlayerRaceCheckpoint(playerid);
- PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
- SetPlayerRaceCheckpoint(playerid,0,-1438.0826,778.1960,46.9262 ,-1603.1776,604.9767,41.4696,10);
- Stats[playerid] = 3;
- }
- case 3:
- {
- DisablePlayerRaceCheckpoint(playerid);
- PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
- SetPlayerRaceCheckpoint(playerid,0,-1603.1776,604.9767,41.4696 ,-1730.6274,474.5914,38.3835,10);
- Stats[playerid] = 4;
- }
- case 4:
- {
- DisablePlayerRaceCheckpoint(playerid);
- PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
- SetPlayerRaceCheckpoint(playerid,0,-1730.6274,474.5914,38.3835 ,-1866.0215,232.0442,38.5611,10);
- Stats[playerid] = 5;
- }
- case 5:
- {
- DisablePlayerRaceCheckpoint(playerid);
- PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
- SetPlayerRaceCheckpoint(playerid,0,-1866.0215,232.0442,38.5611 ,-1899.3824,-258.9382,38.2422,10);
- Stats[playerid] = 6;
- }
- case 6:
- {
- DisablePlayerRaceCheckpoint(playerid);
- PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
- SetPlayerRaceCheckpoint(playerid,0,-1899.3824,-258.9382,38.2422 ,-1898.9611,-866.9935,44.9531,10);
- Stats[playerid] = 7;
- }
- case 7:
- {
- DisablePlayerRaceCheckpoint(playerid);
- PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
- SetPlayerRaceCheckpoint(playerid,0,-1898.9611,-866.9935,44.9531 ,-1898.7498,-1216.3274,39.4844,10);
- Stats[playerid] = 8;
- }
- case 8:
- {
- DisablePlayerRaceCheckpoint(playerid);
- PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
- SetPlayerRaceCheckpoint(playerid,0,-1898.7498,-1216.3274,39.4844 ,-1907.8506,-1314.1133,39.4766,10);
- Stats[playerid] = 9;
- }
- case 9:
- {
- DisablePlayerRaceCheckpoint(playerid);
- PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
- SetPlayerRaceCheckpoint(playerid,0,-1907.8506,-1314.1133,39.4766 ,-1910.0282,-1266.9955,39.4766,10);
- Stats[playerid] = 10;
- }
- case 10:
- {
- DisablePlayerRaceCheckpoint(playerid);
- PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
- SetPlayerRaceCheckpoint(playerid,0,-1910.0282,-1266.9955,39.4766 ,-1953.3282,-1233.2831,39.4844,10);
- Stats[playerid] = 11;
- }
- case 11:
- {
- DisablePlayerRaceCheckpoint(playerid);
- PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
- SetPlayerRaceCheckpoint(playerid,0,-1953.3282,-1233.2831,39.4844 ,-1987.3389,-1067.7865,32.0234,10);
- Stats[playerid] = 12;
- }
- case 12:
- {
- DisablePlayerRaceCheckpoint(playerid);
- PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
- SetPlayerRaceCheckpoint(playerid,0,-1987.3389,-1067.7865,32.0234,-1985.0624,-865.7950,32.0234,10);
- Stats[playerid] = 13;
- }
- case 13:
- {
- DisablePlayerRaceCheckpoint(playerid);
- PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
- SetPlayerRaceCheckpoint(playerid,0,-1985.0624,-865.7950,32.0234 ,-1942.3215,-859.0550,32.0234,10);
- Stats[playerid] = 14;
- }
- case 14:
- {
- DisablePlayerRaceCheckpoint(playerid);
- PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
- SetPlayerRaceCheckpoint(playerid,0,-1942.3215,-859.0550,32.0234 ,-1886.4285,-860.6800,32.0312,10);
- Stats[playerid] = 15;
- }
- case 15:
- {
- DisablePlayerRaceCheckpoint(playerid);
- PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
- SetPlayerRaceCheckpoint(playerid,1,-1886.4285,-860.6800,32.0312 ,-1876.5088,-846.1639,32.0234,10);
- Stats[playerid] = 16;
- }
- case 16:
- {
- DisablePlayerRaceCheckpoint(playerid);
- PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
- SetPlayerRaceCheckpoint(playerid,1,-1876.5088,-846.1639,32.0234,-1876.5088,-846.1639,32.0234,10);
- Stats[playerid] = 17;
- SetPlayerVirtualWorld(playerid, 3);
- //
- new name[MAX_PLAYER_NAME],string[128];
- new Prize[2];
- GetPlayerName(playerid,name,sizeof(name));
- Position++;
- switch(Position)
- {
- case 1: Prize[0] = 10000, Prize[1] = 5;
- case 2: Prize[0] = 5000, Prize[1] = 4;
- case 3: Prize[0] = 3000, Prize[1] = 3;
- case 4: Prize[0] = 3000, Prize[1] = 2;
- case 5: Prize[0] = 3000, Prize[1] = 2;
- case 6: Prize[0] = 1000, Prize[1] = 1;
- case 7: Prize[0] = (random(random(200)) + 400), Prize[1] = 1;
- case 8: Prize[0] = (random(random(150)) + 300), Prize[1] = 1;
- case 9: Prize[0] = (random(random(100)) + 200), Prize[1] = 1;
- default: Prize[0] = random(random(100)), Prize[1] = 1;
- }
- format(string, sizeof(string), ">> "#LIGHTBLUE"\"%s\" "#GREEN"has finished the race in position "#RED"NO: \"%d\".", name, Position);
- SendClientMessageToAll(purple, string);
- GivePlayerMoney(playerid, Prize[0]);
- SetPlayerScore(playerid, GetPlayerScore(playerid) + Prize[1]);
- DisablePlayerRaceCheckpoint(playerid);
- new veh;
- veh = GetPlayerVehicleID(playerid);
- DestroyVehicle(veh);
- }
- }
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- DisablePlayerRaceCheckpoint(playerid);
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys == KEY_SUBMISSION)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(GetPlayerMoney(playerid) >= 300)
- {
- SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0);
- RepairVehicle(GetPlayerVehicleID(playerid));
- GivePlayerMoney(playerid,-300);
- PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
- }
- else
- {
- SendClientMessage(playerid,purple,"You Dont Have Enough Money");
- }
- }
- else
- {
- SendClientMessage(playerid,purple,"*You Must Be in Vehicle To Use Repaired!");
- }
- }
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- { new
- playerScores[MAX_PLAYERS][rankingEnum],
- index
- ;
- for(new i; i != MAX_PLAYERS; ++i)
- {
- if(IsPlayerConnected(i) && !IsPlayerNPC(i))
- {
- playerScores[index][player_Score] = GetPlayerScore(i);
- playerScores[index++][player_ID] = i;
- }
- }
- GetPlayerHighestScores(playerScores, 0, index);
- new
- score_Text[256] = "~n~",
- player_Name[20]
- ;
- for(new i; i < 5; ++i)
- {
- if(i < index)
- {
- GetPlayerName(playerScores[i][player_ID], player_Name, sizeof(player_Name));
- format(score_Text, sizeof(score_Text), "%s~n~~b~%d. ~w~%s - ~r~%d", score_Text, i + 1, player_Name, playerScores[i][player_Score]);
- }
- else
- format(score_Text, sizeof(score_Text), "%s~n~~b~%d. ~r~N/A", score_Text, i + 1);
- }
- TextDrawSetString(text_Top5[1], score_Text);
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- stock GetPlayerHighestScores(array[][rankingEnum], left, right)
- {
- new
- tempLeft = left,
- tempRight = right,
- pivot = array[(left + right) / 2][player_Score],
- tempVar
- ;
- while(tempLeft <= tempRight)
- {
- while(array[tempLeft][player_Score] > pivot) tempLeft++;
- while(array[tempRight][player_Score] < pivot) tempRight--;
- if(tempLeft <= tempRight)
- {
- tempVar = array[tempLeft][player_Score], array[tempLeft][player_Score] = array[tempRight][player_Score], array[tempRight][player_Score] = tempVar;
- tempVar = array[tempLeft][player_ID], array[tempLeft][player_ID] = array[tempRight][player_ID], array[tempRight][player_ID] = tempVar;
- tempLeft++, tempRight--;
- }
- }
- if(left < tempRight) GetPlayerHighestScores(array, left, tempRight);
- if(tempLeft < right) GetPlayerHighestScores(array, tempLeft, right);
- }
- public GameOver(playerid)
- {
- SendRconCommand("changemode GM2");
- GameTextForAll("~y~Changing Game ~n~ ~w~Please Wait....",5000,1);
- KillTimer(GameTimer);
- for(new i;i<15;++i)
- {
- SendClientMessageToAll(purple," ");
- }
- TextDrawHideForPlayer(playerid,Textdraw0);
- TextDrawHideForPlayer(playerid,Textdraw1);
- TextDrawHideForPlayer(playerid,Textdraw2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement