Custura

Untitled

Apr 10th, 2017
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 KB | None | 0 0
  1. [01:50:41] [debug] #0 0031cfec in public cmd_attack (playerid=1, params[]=@0505917c "") at C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp.pwn:50278
  2.  
  3. Linia 50278:
  4. if(InWar[TurfInfo[turf][zOwned]] == 1) return SCM(playerid, TEAM_AZTECAS_COLOR, "Error: This mafia have active war.");
  5.  
  6. Cod comanda:
  7. CMD:attack(playerid, params[])
  8. {
  9. new hour,minn,sec;
  10. gettime(hour,minn,sec);
  11. if(hour != 1) return SCM(playerid,COLOR_WHITE,"{FFB870}Error: Now you can't use this command.");
  12. if(!IsAMember(playerid)) return SCM(playerid,COLOR_WHITE,"{FFB870}Error: You are not a member of the Mafia.");
  13. if(PlayerData[playerid][pFactionRank] < 3) return SCM(playerid,TEAM_AZTECAS_COLOR,"Error: You do not have rank 3.");
  14. new turf,faction,string[100],sendername[MAX_PLAYER_NAME];
  15. for(new i = 1; i <= sizeof(TurfInfo); i++)
  16. {
  17. if(IsPlayerInTurf(playerid, i) == 0)
  18. {
  19. turf = i;
  20. break;
  21. }
  22. }
  23. GetPlayerName(playerid, sendername, sizeof(sendername));
  24. if(turf == 0) return SCM(playerid, TEAM_AZTECAS_COLOR, "Error: You are not on a territory.");
  25. faction = PlayerData[playerid][pFaction];
  26. if(TurfInfo[turf][zOwned] == faction) return SCM(playerid, TEAM_AZTECAS_COLOR, "Error: You can't attack your own turf.");
  27. if(WarInfo[turf][wAttacker] != 0) return SCM(playerid, TEAM_AZTECAS_COLOR, "Error: Turf is already attacked.");
  28. if(TurfInfo[turf][zTime] > 0)
  29. {
  30. format(string,sizeof(string),"Error: Turf can be attacked in %d hours.",TurfInfo[turf][zTime]);
  31. SCM(playerid, TEAM_AZTECAS_COLOR,string);
  32. return 1;
  33. }
  34. if(InWar[faction] == 1) return SCM(playerid, TEAM_AZTECAS_COLOR, "Error: You have an active war.");
  35. if(InWar[TurfInfo[turf][zOwned]] == 1) return SCM(playerid, TEAM_AZTECAS_COLOR, "Error: This mafia have active war.");
  36. TurfInfo[turf][zTime] = 24;
  37. new query[128];
  38. format(query, sizeof(query), "UPDATE `turfs` SET `Time`='24' WHERE `ID`='%d'",turf);
  39. mysql_tquery(g_iHandle, query);
  40. WarInfo[turf][wTime] = 900;
  41. WarInfo[turf][wAttacker] = faction;
  42. WarInfo[turf][wFaction] = TurfInfo[turf][zOwned];
  43. format(string,sizeof(string),"Your mafia (%s) attacked turf %d owned by %s",sendername,turf,Faction_GetName(TurfInfo[turf][zOwned]));
  44. SendFactionMessage(faction,TEAM_AZTECAS_COLOR,string);
  45. format(string,sizeof(string),"Turf %d, Time remaining: %s",turf,CalculeazaTimp(WarInfo[turf][wTime]));
  46. SendFactionMessage(faction,TEAM_AZTECAS_COLOR,string);
  47. format(string,sizeof(string),"%s (%s) attacked your turf %d",Faction_GetName(WarInfo[turf][wAttacker]),sendername,turf);
  48. SendFactionMessage(TurfInfo[turf][zOwned],TEAM_AZTECAS_COLOR,string);
  49. format(string,sizeof(string),"Turf %d, Time remaining: %s",turf,CalculeazaTimp(WarInfo[turf][wTime]));
  50. SendFactionMessage(TurfInfo[turf][zOwned],TEAM_AZTECAS_COLOR,string);
  51. worstscoreat[turf] = 0;
  52. worstmemberat[turf] = 999;
  53. bestscoreat[turf] = 0;
  54. bestmemberat[turf] = 999;
  55. worstscoredf[turf] = 0;
  56. worstmemberdf[turf] = 999;
  57. bestscoredf[turf] = 0;
  58. bestmemberdf[turf] = 999;
  59. InWar[TurfInfo[turf][zOwned]] = 1;
  60. InWar[faction] = 1;
  61. return 1;
  62. }
Advertisement
Add Comment
Please, Sign In to add comment