Advertisement
Custura

Untitled

Apr 9th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.29 KB | None | 0 0
  1. [11:06:19] [debug] #0 00067dc8 in public IsPlayerInTurf (playerid=0, turfid=49) at C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp.pwn:4418
  2.  
  3. public IsPlayerInTurf(playerid, turfid)
  4. {
  5. if(IsPlayerConnected(playerid))
  6. {
  7. if(turfid == -1)
  8. {
  9. return 0;
  10. }
  11. new Float:x, Float:y, Float:z;
  12. GetPlayerPos(playerid,x,y,z);
  13. if(x >= TurfInfo[turfid][zMinX] && x < TurfInfo[turfid][zMaxX] && y >= TurfInfo[turfid][zMinY] && y < TurfInfo[turfid][zMaxY]) //asta e linia 4418
  14. {
  15. return 1;
  16. }
  17. }
  18. return 0;
  19. }
  20.  
  21.  
  22. [11:06:19] [debug] #1 00318768 in public cmd_attack (playerid=0, params[]=@05078224 "") at C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp.pwn:50014
  23.  
  24. CMD:attack(playerid, params[]) {
  25. if(!IsAMember(playerid)) return SendClientMessage(playerid,COLOR_GREY, "Nu faci parte dintr-o mafie.");
  26. if(PlayerData[playerid][pFactionRank] < 3) return SendClientMessage(playerid,COLOR_LIGHTBLUE,"You do not have rank 3.");
  27. new turf,string[100];
  28. for(new i = 1; i <= sizeof(TurfInfo); i++) {
  29. if(IsPlayerInTurf(playerid, i) == 1) { // asta e linia 50014
  30. turf = i;
  31. break;
  32. }
  33. }
  34. new hour,minute,second, year, month, day;
  35. gettime(hour,minute,second);
  36. getdate(year, month, day);
  37. new days[180];
  38. format(days, sizeof(days), GetWeekDay(day, month, year));
  39. if(PlayerData[playerid][pAdmin] < 7) {
  40. if(strcmp(days,"Saturday",true) == 0 || strcmp(days,"Sunday",true) == 0) return SCM(playerid, COLOR_LIGHTRED, "Nu se dau war-uri in weekend!");
  41. if(hour == 20 || hour == 21) {}
  42. else return SendClientMessage(playerid, COLOR_LIGHTRED, "War-uri se pot da doar in intervalul 20:00 - 22:00!");
  43. if(GetFactionMembersOn2(PlayerData[playerid][pFaction]) < 2) return SCM(playerid, COLOR_LGREEN, "Nu poti folosi aceasta comanda deoarece nu sunt minim 2 membri conectati din factiunea ta!");
  44. if(GetFactionMembersOn2(TurfInfo[turf][zOwned]) < 2) return SCM(playerid, COLOR_LGREEN, "Nu poti folosi aceasta comanda deoarece nu sunt minim 2 membri conectati din factiunea care detine teritoriul!");
  45. }
  46. if(turf == 0) return SendClientMessage(playerid, COLOR_WHITE, "Nu esti pe un teritoriu!");
  47. new faction = PlayerData[playerid][pFaction];
  48. if(TurfInfo[turf][zOwned] == faction) return SendClientMessage(playerid, COLOR_GREY, "Nu poti ataca turful mafiei tale.");
  49. if(WarInfo[turf][wAttacker] != 0) return SendClientMessage(playerid, COLOR_WHITE, "Acest turf este deja atacat.");
  50. if(InWar[faction] == 1) return SendClientMessage(playerid, COLOR_WHITE, "Este deja un war activ.");
  51. if(InWar[TurfInfo[turf][zOwned]] == 1) return SendClientMessage(playerid, COLOR_WHITE, "Aceasta mafie are deja un war activ.");
  52. if(FactionDeelay[PlayerData[playerid][pFaction]] != 0) {
  53. format(string, sizeof(string), "Poti folosi aceasta comanda peste %d minute (%d secunde).", FactionDeelay[PlayerData[playerid][pFaction]]/60, FactionDeelay[PlayerData[playerid][pFaction]]);
  54. SCM(playerid, COLOR_LGREEN, string);
  55. return 1;
  56. }
  57. format(string, sizeof(string), "[WAR] %s a atacat teritoriul %d detinut de factiunea %s.",ReturnName(playerid),turf,Faction_GetName(TurfInfo[turf][zOwned]));
  58. SendFactionMessage(faction,COLOR_RED,string);
  59. format(string, sizeof(string), "[WAR] %s (%s) a atacat teritoriul %d detinut de factiunea ta.",Faction_GetName(WarInfo[turf][wAttacker]),ReturnName(playerid),turf);
  60. SendFactionMessage(TurfInfo[turf][zOwned],COLOR_RED,string);
  61. new query[128];
  62. format(query,sizeof(query),"UPDATE `turfs` SET `Time`='24' WHERE `ID`='%d'",turf);
  63. mysql_query(SQL,query);
  64.  
  65. TurfInfo[turf][zTime] = 24;
  66. WarInfo[turf][wTime] = 1200;
  67. WarInfo[turf][wAttacker] = faction;
  68. WarInfo[turf][wFaction] = TurfInfo[turf][zOwned];
  69. worstscoreat[turf] = 0;
  70. worstmemberat[turf] = 999;
  71. bestscoreat[turf] = 0;
  72. bestmemberat[turf] = 999;
  73. worstscoredf[turf] = 0;
  74. worstmemberdf[turf] = 999;
  75. bestscoredf[turf] = 0;
  76. bestmemberdf[turf] = 999;
  77. InWar[TurfInfo[turf][zOwned]] = 1;
  78. InWar[faction] = 1;
  79.  
  80. InWarTurf[faction] = turf;
  81. InWarTurf[TurfInfo[turf][zOwned]] = turf;
  82.  
  83. /*foreach(Player, i) {
  84. if(PlayerData[i][pLogged] == 1) {
  85. if(PlayerData[i][pFaction] == faction || PlayerData[i][pFaction] == TurfInfo[turf][zOwned]) UpdateVar(i, "WarTurf", turf);
  86. }
  87. }*/
  88.  
  89. SetVehicle(faction, turf);
  90. SetVehicle(TurfInfo[turf][zOwned], turf);
  91. return 1;
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement