Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //news
- #include <a_samp>
- forward StartGunGame();
- forward EndGunGame();
- new gungame = 0;
- #define COLOR_WHITE 0xFFFFD5FF
- #define COLOR_YELLOW 0xFFFF00AA
- new PlayerLevel[ MAX_PLAYERS ];
- new rand;
- new sendername[MAX_PLAYER_NAME];
- //================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(PlayerLevel[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(PlayerLevel[i] != 0)
- {
- SendClientMessage(i , COLOR_YELLOW ,"Eventul a luat sfarsit!");
- PlayerLevel[i] = 0;
- SetPlayerHealth(i , 0);
- }
- }
- }
- public OnPlayerConnect(playerid)
- {
- PlayerLevel[playerid] = 0;
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(PlayerLevel[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);
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- //=======================oNPLAYERCOMMANDTEXT
- if (strcmp(cmdtext, "/gungame", true)==0)
- {
- if(gungame == 1)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- SendClientMessageToAll(COLOR_WHITE,"Un nou event GunGame s-apornit! Inscrierile se fac in 30 secunde /participa pentru a intra");
- 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)
- {
- if(PlayerLevel[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);
- PlayerLevel[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!");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement