Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //news
- forward StartGunGame();
- forward EndGunGame();
- new gungame = 0;
- new PlayerGunGame[MAX_PLAYERS];
- //================GUNGAMES PAWNS==========
- new Float:GunGameSpawns[7][3] = {
- {-995.0154,1025.5668,1341.8438},
- {-1020.5804,1054.4423,1343.1704},
- {-1048.7465,1058.3806,1343.9280},
- {-1069.9495,1090.6516,1343.3184},
- {-1092.4832,1040.9879,1343.5192},
- {-1132.3622,1024.1381,1345.7261},
- {-971.7485,1090.6906,1344.9961}
- };
- //====================PUBLIC START GUNGAME=============
- public StartGunGame()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(PlayerGunGame[i] != 0)
- {
- TogglePlayerControllable(i, 1);
- SendClientMessageToAll(COLOR_WHITE, "Inscriierile la event s-au terminat!");
- SendClientMessage(i, COLOR_YELLOW, "START!!!!!");
- gungame = 1;
- SetTimer("EndGunGame", 240000, 0);
- }
- }
- }
- return 1;
- }
- //-=========================pUBLIC ENDGUNGAME
- public EndGunGame()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(PlayerGunGame[i] != 0)
- {
- SendClientMessage(i , COLOR_YELLOW ,"Eventul a luat sfarsit!");
- PlayerGunGame[i] = 0;
- SetPlayerHealth(i , 0);
- SetPlayerToTeamColor(i);
- }
- }
- }
- //==========ON PLAYER CONNECT
- PlayerGunGame[playerid] = 0;
- //============================oNPLAYERDEATH
- if(PlayerGunGame[playerid] != 0)
- {
- rand = random(sizeof(GunGameSpawns));
- SetPlayerPos(playerid, GunGameSpawns[rand][0], GunGameSpawns[rand][1], GunGameSpawns[rand][2]);
- SendClientMessage(killerid,COLOR_WHITE,"Ai omorat un om primesti 5 000$");
- GivePlayerMoney(playerid, 5000);
- GivePlayerWeapon(playerid, 29, 999);
- GivePlayerWeapon(playerid, 24, 999);
- }
- //=======================oNPLAYERCOMMANDTEXT
- if (strcmp(cmdtext, "/gungame", true)==0)
- {
- if(gungame = 1)
- {
- if(PlayerInfo[playerid][pAdmin] > 4)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- SendClientMessageToAll(COLOR_WHITE,"Un nou event GunGame s-apornit! Inscrierile se fac in 30 secunde /participa pentru a intra");
- format(string, sizeof(string), "Atentie: Admin %s a pornit un event GunGame!", sendername);
- SendAdminMessage(COLOR_YELLOW, string);
- SetTimer("StartGunGame", 30000, 0);
- gungame = 0;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "Un event GunGame e deja pornit , nu mai poti porni altul!");
- }
- }
- //======================PARTICIPA
- if (strcmp(cmdtext, "/participa", true)==0)
- {
- if (gungame != 0)
- {
- new rand;
- if(PlayerGunGame[playerid] != 0)
- {
- rand = random(sizeof(GunGameSpawns));
- SetPlayerPos(playerid, GunGameSpawns[rand][0], GunGameSpawns[rand][1], GunGameSpawns[rand][2]);
- SendClientMessage(playerid, COLOR_WHITE, "Ai intrat la event!");
- SetPlayerHealth(playerid, 100.0);
- PlayerGunGame[playerid] = 1;
- GivePlayerWeapon(playerid, 29, 999);
- GivePlayerWeapon(playerid, 24, 999);
- TogglePlayerControllable(playerid, 0);
- SendClientMessage(playerid, COLOR_YELLOW, "Meciul incepe imediat!");
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "Esti deja la event!");
- }
- }
- else
- {
- SendClientMessage(playerid , COLOR_WHITE ,"Nu este niciun event activ!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement