Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- /*
- System: War Activity
- Bulid By ron - biton
- BigMaN && EviLpRo
- */
- //===[Colors]==
- #define green 0xc7ff00ff
- #define red 0xff3300ff
- #define yellow 0xffff00ff
- #define blue 0x500bdff
- #define lightBlue 0x00ccffff
- //==[הגדרות - ניתן לשינוי]==
- #define Price 10000 // כמות הכסף שיקבל הזוכה
- #define Block 12 // מספר מקומות מוגבל, אם אתם מוסיפים אחד תוסיפו גם ספאון אחד
- #define CDN 40 // המספר שתתחיל ממנו הספירה הראשונה
- #define CDN2 10 // המספר שתתחיל ממנו הסיפרה השניה
- #define MinPlayers 2 // מספר מקומות מינימלי
- #define Money 200 // עלות כניסה לפעילות
- //===[משתנים]==
- new cd;
- new WarOn;
- new WarPlayers;
- new InWar[MAX_PLAYERS];
- new WarReg;
- new String[256];
- new Float:WarSpawns[12][3] ={
- {-1381.7242,1276.9611,1039.8672},
- {-1401.8888,1261.0510,1039.8741},
- {-1394.1561,1274.2472,1039.8672},
- {-1387.2743,1263.0626,1039.8741},
- {-1379.1420,1248.4054,1039.8672},
- {-1379.1001,1219.6829,1039.8672},
- {-1391.4531,1221.6755,1039.8672},
- {-1402.0007,1217.9125,1039.8672},
- {-1415.1235,1238.4708,1039.8672},
- {-1410.9012,1260.8301,1040.4379},
- {-1397.9063,1260.1892,1039.8741},
- {-1383.9586,1269.8687,1039.8672}
- };
- new WarWeapons[14] = {
- 22,23,24,25,26,27,28,29,30,31,32,33,5,9
- };
- //===[Forward's]==
- forward WarCount();
- forward WarCount2();
- forward CheckWinner();
- forward ToWar();
- forward UnFreeze();
- public OnPlayerDeath(playerid,killerid,reason)
- {
- if(InWar[playerid] == 1)
- {
- WarPlayers--;
- ResetPlayerWeapons(playerid);
- SendClientMessage(playerid,red,".יצאת מהפעילות");
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid,reason)
- {
- if(InWar[playerid] == 1)
- {
- WarPlayers--;
- }
- return 1;
- }
- public OnPlayerCommandText(playerid,cmdtext[])
- {
- if(strcmp(cmdtext,"/WarStart",true)==0)
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,red,"ERROR: פקודה זו היא לאדמינים בלבד");
- if(WarOn == 1) return SendClientMessage(playerid,red,"ERROR: פעילות זו כבר מופעלת");
- WarReg = 1;
- WarCount();
- SendClientMessageToAll(lightBlue,"-----[War Activity]-----");
- SendClientMessageToAll(lightBlue,".WaR החלה ההרשמה לפעילות");
- SendClientMessageToAll(lightBlue,"/War - להרשמה הקש פקודה זו");
- SendClientMessageToAll(lightBlue,"Money$ - כניסה לפעילות זו עולה");
- SendClientMessageToAll(lightBlue,"Price$ - הפרס לזוכה בפעילות הוא");
- SendClientMessageToAll(lightBlue,"-----[War Activity]-----");
- return 1;
- }
- if(strcmp(cmdtext,"/WarEnd",true)==0)
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,red,"ERROR: פקודה זו היא רק לאדמינים");
- if(WarOn) return SendClientMessage(playerid,red,"ERROR: פעילות זו אינה מופעלת");
- format(String,256,"War ביטל את פעילות ה \"%s\" האדמין",GetName(playerid));
- SendClientMessageToAll(yellow,String);
- WarOn = 0;
- WarPlayers = 0;
- for(new i = 0; i < GetMaxPlayers(); i++)
- {
- if(IsPlayerConnected(i) && InWar[i] == 1)
- {
- SpawnPlayer(i);
- }
- }
- return 1;
- }
- if(strcmp(cmdtext,"/War",true)==0)
- {
- if(WarOn == 0) return SendClientMessage(playerid,red,"ERROR: פעילות זו אינה מופעלת כעת");
- if(WarReg == 0) return SendClientMessage(playerid,red,"ERROR: הפעילות כבר החלה");
- if(WarPlayers == Block) return SendClientMessage(playerid,red,"ERROR: נגמרו כל המקומות בפעילות");
- SendClientMessageToAll(lightBlue,"---------[War Activity]---------");
- SendClientMessageToAll(lightBlue,".הצטרפת לפעילות בהצלחה");
- SendClientMessageToAll(lightBlue,"בפעילות זאת מטרתך העיקרית היא לשרוד אחרון");
- SendClientMessageToAll(lightBlue,"כדי לעשות זאת , תצטרך להתחמק מיריות של אחרים");
- SendClientMessageToAll(lightBlue,"ולהרוג את כל מי שעומד בדרכך (:");
- SendClientMessageToAll(lightBlue,"בהצלחה בפעילות, מקווים שתזכה..");
- SendClientMessageToAll(lightBlue,"---------[War Activity]---------");
- InWar[playerid] = 1;
- WarPlayers++;
- return 1;
- }
- if(strcmp(cmdtext,"/WarExit",true)==0)
- {
- if(WarOn == 0) return SendClientMessage(playerid,red,"ERROR: פעילות זו אינה מופעלת כעת");
- if(InWar[playerid]) return SendClientMessage(playerid,red,"ERROR: אתה לא בפעילות");
- SpawnPlayer(playerid);
- InWar[playerid] = 0;
- WarPlayers--;
- SendClientMessage(playerid,red,".יצאת מהפעילות");
- return 1;
- }
- return 0;
- }
- public WarCount()
- {
- new cdt[256];
- format(cdt,256,"~y~WaR: ~w~%d",cd);
- if(cd > 0)
- {
- GameTextForAll(cdt,1000,6);
- SetTimer("WarCount",1000,0);
- } else if(cd == 15) {
- SendClientMessageToAll(green,"• /War - הפעילות תתחיל בעוד 15 שניות להצטרפות הקש •");
- } else {
- if(WarPlayers < MinPlayers) return SendClientMessageToAll(red,"הפעילות בוטלה, סיבה: חוסר משתתפים");
- cd = CDN2;
- WarReg = 0;
- WarCount2();
- ToWar();
- for(new i=0;i<GetMaxPlayers();i++)
- {
- if(IsPlayerConnected(i) && InWar[i] == 1)
- {
- SendClientMessage(i,green,".שוגרת לפעילות, הפעילות תתחיל בעוד מספר שניות");
- }
- }
- }
- return 1;
- }
- public WarCount2()
- {
- new cdt1[256];
- format(cdt1,256,"~y~Start IN: ~w~%d",cd);
- if(cd > 0)
- {
- GameTextForAll(cdt1,1000,6);
- SetTimer("WarCount",1000,0);
- } else {
- UnFreeze();
- SendClientMessageToAll(red,".הפעילות החלה בהצלחה למתמודדים");
- }
- }
- public ToWar()
- {
- CheckWinner();
- for(new i = 0; i < GetMaxPlayers();i++)
- {
- if(IsPlayerConnected(i) && InWar[i] == 1)
- {
- new Rand = random(sizeof(WarSpawns));
- SetPlayerPos(i,WarSpawns[Rand][0],WarSpawns[Rand][1],WarSpawns[Rand][2]);
- TogglePlayerControllable(i,0);
- SetPlayerInterior(i,16);
- SendClientMessage(i,yellow,".שוגרת לפעילות, הפעילות תתחיל בעוד מספר שניות");
- }
- }
- return 1;
- }
- public UnFreeze()
- {
- for(new i = 0; i < GetMaxPlayers();i++)
- {
- if(IsPlayerConnected(i) && InWar[i] == 1)
- {
- TogglePlayerControllable(i,1);
- new Rand = random(sizeof(WarWeapons));
- GivePlayerWeapon(i,WarWeapons[Rand],10000);
- }
- }
- return 1;
- }
- public CheckWinner()
- {
- if(WarPlayers > 1) return SetTimer("CheckWinner",1000,0);
- for(new i = 0; i < GetMaxPlayers(); i++)
- {
- if(IsPlayerConnected(i) && InWar[i] == 1 && !WarOn)
- {
- GivePlayerMoney(i,Price);
- format(String,256,"• %s Winner in Mini",GetName(i));
- GameTextForAll(String,4000,4);
- format(String,256,"• Warזכה בפעילות ה %s ברכותינו, השחקן •",GetName(i));
- SendClientMessage(i,green,"כל הכבוד ! זכית בפעילות");
- SendClientMessageToAll(yellow,String);
- SpawnPlayer(i);
- WarPlayers = 0;
- WarOn = 0;
- InWar[i] = 0;
- }
- }
- return 1;
- }
- stock GetName(playerid)
- {
- new Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
- return Name;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement