Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Scripted by Ruben..
- #include <a_samp>
- #include <streamer>
- #include <F_Menu>
- #include <YSI>
- 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 LIGHTBLUES 0x00AFFFFF
- #define COLOR_WHITE 0xFFFFFFFF
- #define GM2 2
- new S1;
- new GameMinutes =5;
- 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
- #define TOP5 true
- new
- Text: text_Top5[2]
- ;
- enum rankingEnum
- {
- player_Score,
- player_ID
- }
- main()
- {
- print("\n----------------------------------");
- print(" Marina Militare \n GM No: 22 \n Date Created: 15/02/2012");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- SetTimer("BlueTeam",360000,0);
- UsePlayerPedAnims();
- F_Menu_OnInit();
- //MENU
- S1 = F_CreateMenu("Aiuto - comandi", 200.0, 200.0, 300.0);
- F_SetMenuTitleBgColor(S1, 0xFF1400FF);
- F_SetMenuSelectedItemBgColor(S1, 0xFF1400FF);
- F_AddMenuItem(S1, "Comandi utente");
- F_AddMenuItem(S1, "Comandi vip");
- //
- for(new i;i<15;++i)
- {
- SendClientMessageToAll(purple," ");
- }
- // Don't use these lines if it's a filterscript
- SetGameModeText("Marina Militare");
- 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" , 370000 , true ) ;
- iTimerToExit = false ;
- }
- //Vehicles
- 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~GARA~n~~r~FINITA!",2000,0);
- SetTimer("GameModeExitFunc",3000,0);
- }
- //---------------------------------
- public OnPlayerConnect(playerid)
- {
- GameTextForPlayer(playerid,"~w~Mar~y~ina~n~~r~Mili~w~tare~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)
- {
- SetCameraBehindPlayer(playerid);
- if ( iRaceIsStarted == true ) {
- TogglePlayerControllable ( playerid , 1 ) ;
- GameTextForPlayer ( playerid , "Gara gia' partita~r~sei in ritardo!" , 3000 , 3 ) ;
- }
- else {
- TogglePlayerControllable ( playerid , 0 ) ;
- }
- SetPlayerPos(playerid,-1352.2531,510.9414,11.1953);
- SetPlayerColor(playerid,0xAFFF00FF);
- TextDrawShowForPlayer(playerid, text_Top5[0]);
- TextDrawShowForPlayer(playerid, text_Top5[1]);
- 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,"Dona per il nostro server su foroum-insanity.it!");
- }
- public iStartRace ( ) {
- iCountdown-- ;
- switch ( iCountdown ) {
- case 0: {
- GameTextForAll ( "~g~VIA ~r~VIA ~y~VIA!!!" , 1000 , 3 ) ;
- TextDrawHideForAll(Textdraw5);
- iTimeToExit = true ;
- KillTimer ( iStartCountdown ) ;
- iRaceIsStarted = true ;
- for ( new i = 0 ; i < MAX_PLAYERS ; i++ ) {
- TogglePlayerControllable ( i , true ) ;
- }
- }
- case 1: {
- GameTextForAll ( "~b~1..." , 1000 , 3 ) ;
- TextDrawSetString(Textdraw5,"~g~1");
- TextDrawSetString(Textdraw5,"~g~GO ~w~!!");
- }
- case 2: {
- GameTextForAll ( "~g~...2..." , 1000 , 3 ) ;
- TextDrawSetString(Textdraw5,"~y~2");
- TextDrawSetString(Textdraw5,"~g~1");
- }
- case 3: {
- GameTextForAll ( "~r~....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,"***In questa missione lo shop รจ disabilitato***");
- return 1;
- }
- if(!strcmp(cmdtext, "/aiuto", true))
- {
- F_ShowMenuForPlayer(S1, playerid);
- TogglePlayerControllable(playerid, false);
- return 1;
- }
- return SendClientMessage(playerid,COLOR_RED,"Comando non valido, usa /aiuto per vederli tutti!");
- }
- 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)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(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)
- {
- 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 GM1");
- GameTextForAll("~y~Stiamo cambiando la mode ~n~ ~w~Aspetta 5 secondi....~n~American Choppers",5000,1);
- KillTimer(GameTimer);
- for(new i;i<15;++i)
- {
- SendClientMessageToAll(purple," ");
- }
- TextDrawHideForPlayer(playerid,Textdraw0);
- TextDrawHideForPlayer(playerid,Textdraw1);
- TextDrawHideForPlayer(playerid,Textdraw2);
- }
- public F_OnPlayerSelectedMenuRow(playerid, menuid, row)
- {
- if(menuid == S1)
- {
- switch(row)
- {
- case 0:
- {
- SendClientMessage(playerid,COLOR_WHITE,"-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
- SendClientMessage(playerid,LIGHTBLUES," /me, /report <id> <motivo>, /shop, /register, /login, /id");
- SendClientMessage(playerid,LIGHTBLUES," /admins, /premiums, /regole, /paga, /suicidio, /stats <id> (se lasci bianco spuntano le tue)");
- SendClientMessage(playerid,LIGHTBLUES," /pm <id>, /orologio, /resettastats, /richlist, /top5, /lotto, /minigames");
- SendClientMessage(playerid,COLOR_WHITE,"-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
- TogglePlayerControllable(playerid, true);
- }
- case 1:
- {
- ShowPlayerDialog(playerid,1234,DIALOG_STYLE_MSGBOX,"Premium",""#CLIGHTBLUE" Comandi premium\n\n-pc\n-pshop","Ok","");
- TogglePlayerControllable(playerid, true);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment