Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //________Sommerferien________//
- #include <a_samp>
- #include <zcmd>
- #include <foreach>
- #define MIN_OS 4 //Anzahl der Spieler die da sein müssen.
- #define START_OS 20 //Zeit wann es Starten soll
- #define X 2140.1648 // Position X
- #define Y 993.7104 // Position Y
- #define Z 10.8203 // Position Z
- new SpeicherEvent[MAX_PLAYERS];
- new BlockEvent[MAX_PLAYERS];
- new SpeicherOneshoot[MAX_PLAYERS];
- new SpielerOneshoot;
- new StartOneshoot;
- new TimeOneshoot;
- new TimerOneshoot;
- new Text:Oneshoot;
- new Float:RandomOnedeSpawn[][] =
- {
- {288.7459, 169.3509, 1007.1718},
- {273.3204, 188.1061, 1007.1719},
- {263.6746, 170.5629, 1003.0234},
- {236.7647, 195.1310, 1008.1719},
- {257.2431, 185.3781, 1008.1719},
- {213.7057, 147.3681, 1003.0234},
- {212.9781, 166.3744, 1003.0234},
- {197.2282, 158.1888, 1003.0234},
- {210.9119, 184.9424, 1003.0313}
- };
- public OnPlayerConnect(playerid)
- {
- SpeicherOneshoot[playerid] = 0;
- BlockEvent[playerid] = 0;
- SpeicherEvent[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid)
- {
- if(SpeicherOneshoot[playerid] == 1) SpielerOneshoot--;
- return 1;
- }
- public OnPlayerCommandReceived(playerid, cmdtext[])
- {
- if(BlockEvent[playerid] == 1 && strcmp(cmdtext, "/osexit", true)) return SendClientMessage(playerid, -1, "Schreibe /osexit um OneShoot zu verlassen."), 0;
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(StartOneshoot == 1)
- {
- if(SpeicherOneshoot[playerid] == 1)
- {
- SpeicherOneshoot[playerid] = 0;
- SpeicherEvent[playerid] = 0;
- BlockEvent[playerid] = 0;
- TextDrawHideForPlayer(playerid, Oneshoot);
- }
- SpielerOneshoot--;
- }
- return 1;
- }
- public OnFilterScriptInit()
- {
- StartOneshoot = 0;
- Oneshoot = TextDrawCreate(519.000000, 344.000000, "OneShoot: Spieler: Zeit:");
- TextDrawBackgroundColor(Oneshoot, 255);
- TextDrawFont(Oneshoot, 1);
- TextDrawLetterSize(Oneshoot, 0.519999, 1.099999);
- TextDrawColor(Oneshoot, -1);
- TextDrawSetOutline(Oneshoot, 0);
- TextDrawSetProportional(Oneshoot, 1);
- TextDrawSetShadow(Oneshoot, 1);
- TextDrawUseBox(Oneshoot, 1);
- TextDrawBoxColor(Oneshoot, 0x00000060);
- TextDrawTextSize(Oneshoot, 607.000000, 0.000000);
- return 1;
- }
- public OnFilterScriptExit()
- {
- for(new i = 0; i < GetMaxPlayers(); i++) TextDrawDestroy(Oneshoot);
- return 1;
- }
- cmd(oneshoot, playerid, params[])
- {
- if(StartOneshoot == 1) return SendClientMessage(playerid, -1, "OneShoot ist Gestartet. ");
- if(SpeicherOneshoot[playerid] == 1) return SendClientMessage(playerid, -1, "Du bist schon fuer OneShoot Angemeldet. ");
- if(SpeicherEvent[playerid] == 1) return SendClientMessage(playerid, -1, "Du hast keine Zeit. ");
- SendClientMessage(playerid, -1, "Du nimmst am OneShoot teil, um zu verlassen schreibe /osexit");
- SpielerOneshoot++;
- SpeicherOneshoot[playerid] = 1;
- SpeicherEvent[playerid] = 1;
- if(SpielerOneshoot == MIN_OS)
- {
- SendClientMessageToAll(-1, "In 20 Sekunden Startet /OneShoot.");
- SetTimer("StartOneShoot", START_OS*1000, 0);
- }
- return 1;
- }
- cmd(osexit, playerid, params[])
- {
- if(SpeicherOneshoot[playerid] == 0) return SendClientMessage(playerid, -1, "Du nimmst am OneShoot nicht Teil. ");
- if(StartOneshoot == 1)
- {
- if(SpeicherOneshoot[playerid] == 1)
- {
- SpielerOneshoot--;
- SetPlayerPos(playerid, X, Y, Z);
- SpeicherOneshoot[playerid] = 0;
- BlockEvent[playerid] = 0;
- SpeicherEvent[playerid] = 0;
- TextDrawHideForPlayer(playerid, Oneshoot);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- }
- }
- SpeicherOneshoot[playerid] = 0;
- BlockEvent[playerid] = 0;
- SpeicherEvent[playerid] = 0;
- SendClientMessage(playerid, -1, "Du hast Oneshoot verlassen ");
- return 1;
- }
- forward StartOneShoot();
- public StartOneShoot()
- {
- StartOneshoot = 1;
- SendClientMessageToAll(-1, "OneShoot Gestartet. ");
- new LosujArene[1];
- foreach(Player, i)
- {
- if(SpeicherOneshoot[i] == 1)
- {
- TextDrawShowForPlayer(i, Oneshoot);
- BlockEvent[i] = 1;
- SetPlayerHealth(i, 25);
- SetPlayerArmour(i, 0);
- ResetPlayerWeapons(i);
- GivePlayerWeapon(i, 24, 500);
- switch(LosujArene[0])
- {
- case 0:
- {
- SetPlayerInterior(i, 3);
- SetPlayerVirtualWorld(i, 15);
- new rand = random(sizeof(RandomOnedeSpawn));
- SetPlayerPos(i, RandomOnedeSpawn[rand][0], RandomOnedeSpawn[rand][1], RandomOnedeSpawn[rand][2]);
- }
- }
- }
- }
- TimeOneshoot = 0;
- TimeOneshoot = 180;
- KillTimer(TimerOneshoot);
- TimerOneshoot = SetTimer("EndeOneshoot", 1000, 1);
- return 1;
- }
- forward EndeOneshoot();
- public EndeOneshoot()
- {
- TimeOneshoot--;
- new string[128];
- format(string, sizeof string, "~y~OneShoot: ~n~~g~Zeit: ~b~%d~n~~g~Spieler: ~b~%d", TimeOneshoot, SpielerOneshoot);
- TextDrawSetString(Oneshoot, string);
- if(TimeOneshoot == 0)
- {
- SendClientMessageToAll(-1, "Niemand hat OneShoot Gewonnen, Restart!. ");
- KillTimer(TimerOneshoot);
- SpielerOneshoot = 0;
- StartOneshoot = 0;
- foreach(Player, i)
- {
- if(SpeicherOneshoot[i] == 1)
- {
- SpeicherOneshoot[i] = 0;
- BlockEvent[i] = 0;
- SpeicherEvent[i] = 0;
- TextDrawHideForPlayer(i, Oneshoot);
- SetPlayerPos(i, X, Y, Z);
- }
- }
- }
- if(SpielerOneshoot == 1)
- {
- KillTimer(TimerOneshoot);
- SpielerOneshoot = 0;
- StartOneshoot = 0;
- new string2[120];
- foreach(Player, i)
- {
- if(SpeicherOneshoot[i] == 1)
- {
- format(string2, sizeof string2, "Spieler %s [ID: %d] Gewinnt OneShoot. Preis 50000 € und 50 Respektpunkte. ", PlayerName(i), i);
- SendClientMessageToAll(-1, string2);
- SetPlayerScore(i, GetPlayerScore(i) +50);
- GameTextForPlayer(i, "respekt~n~~g~+50", 1000, 1);
- GivePlayerMoney(i, 50000);
- SpeicherOneshoot[i] = 0;
- SpeicherEvent[i] = 0;
- BlockEvent[i] = 0;
- TextDrawHideForPlayer(i, Oneshoot);
- SetPlayerVirtualWorld(i, 0);
- SetPlayerInterior(i, 0);
- SetPlayerPos(i, X, Y, Z);
- }
- }
- }
- if(SpielerOneshoot == 0)
- {
- KillTimer(TimerOneshoot);
- SpielerOneshoot = 0;
- StartOneshoot = 0;
- }
- return 1;
- }
- stock PlayerName(playerid)
- {
- new name[24];
- GetPlayerName(playerid, name, sizeof name);
- return name;
- }
Advertisement
Add Comment
Please, Sign In to add comment