Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Derby Arena
- DerbyEvent[0] = CreateVehicle(502, 1105.6954, 1044.9454, 341.7180+5, 0.0000, -1, -1, 100);
- DerbyEvent[1] = CreateVehicle(502, 1090.0642, 1020.8392, 341.7180+5, 0.0000, -1, -1, 100);
- DerbyEvent[2] = CreateVehicle(502, 1135.8325, 1081.7300, 341.5983+5, 92.5200, -1, -1, 100);
- DerbyEvent[3] = CreateVehicle(502, 1072.9547, 1080.8552, 341.8510+5, 275.4600, -1, -1, 100);
- DerbyEvent[4] = CreateVehicle(502, 1087.6243, 1103.4141, 341.8510+5, 176.1600, -1, -1, 100);
- for(new i =0; i < 5; i++) SetVehicleVirtualWorld(DerbyEvent[4], 1337);
- //DerbyEvent
- new
- DerbyEvent[5],
- DerbyPlayers,
- DerbyStatus,
- DerbyTime,
- InDerby[MAX_PLAYERS],
- DerbyVehicle;
- // Ongamemodeinit
- DerbyTime = 30;
- // Commands
- CMD:derby(playerid, params[]) {
- if(DerbyStatus == 1)
- return SCM(playeri, -1, "Derby Inceput!");
- TogglePlayerControllable(playerid, 0);
- SetPlayerVirtualWorld(playerid, 1337);
- SetVehicleVirtualWorld(DerbyEvent[DerbyPlayers], 1337);
- PutPlayerInVehicle(playerid, DerbyEvent[DerbyPlayers], 0);
- DerbyVehicle[playerid] = DerbyEvent[DerbyPlayers];
- DerbyPlayers++;
- InDerby[playerid] = 1;
- new string[128];
- format(string, sizeof(string), "%s a intrat in arena derby!", GetName(playerid));
- SendDerby(COLOR_YELLOW, string);
- return 1;
- }
- SendDerby(color, text[]) {
- foreach(Playerd, i){
- if(InDerby[i] == 1) {
- SCM(i, color, text);
- }
- }
- return 1;
- }
- function leave_derby(playerid) {
- SetVehicleVirtualWorld(DerbyVehicle[playerid], 1337);
- SetVehicleToRespawn(DerbyVehicle[playerid]);
- SetPlayerVirtualWorld(playerid, 0);
- SpawnPlayer(playerid);
- InDerby[playereid] = 0;
- DerbyPlayers --;
- DerbyVehicle[playerid] = 0;
- SCM(playerid, -1, "debug");
- return 1;
- }
- if(DerbyStatus == 0) {
- if(DerbyTime > 0) {
- DerbyTime--;
- if(DerbyTime == 0){
- if(DerbyPlayers < 1) { // < 2
- foreach(Player, i) {
- if(Derby[i] == 1) leave_derby(i), SCM(i, COLOR_YELLOW "Prea putini playeri!");
- }
- DerbyStatus = 0;
- DerbyTime = 30;
- }
- else {
- DerbyStatus = 1;
- DerbyTime = 60;
- SendDerby(COLOR_YELLOW, "Runda a inceput !");
- foreach(Player, i) {
- if(InDerby[i] == 1) TogglePlayerControllable(i, 1);
- }
- }
- }
- }
- }
- if(DerbyStatus == 1) {
- if(DerbyTime > 0) {
- DerbyTime--;
- if(DerbyTime == 0) {
- foreach(Player, i) {
- if(InDerby[i] ==1) leave_derby(i);
- }
- DerbyStatus = 0;
- DerbyTime = 30;
- SendDerby(COLOR_YELLOW, "Nimeni nu a castigat!");
- }
- else {
- if(DerbyPlayers == 0) { // == 1
- foreach(Player, i) {
- if(Derby[i] == 1) leave_derby(i), SCM(i, COLOR_YELLOW "Felicitari! Ai castigat!");
- }
- DerbyStatus = 0;
- DerbyTime = 30;
- }
- }
- }
- }
- if(InDerby[i] == 1) {
- if(DerbyStatus == 1) {
- new Float: Pos[3];
- GetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
- if(Pos[2] < 329.9276) leave_derby(i);
- }
- }
- // OnPlayereDisconnect si la OnlayerSpawn
- if(InDerby[playerid] == 1) leave_derby(playerid);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement