Guest User

Untitled

a guest
Dec 25th, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.69 KB | None | 0 0
  1. /startwar
  2.  
  3. dcmd_startwar(playerid,params[])
  4. {
  5.     if(IsAFightFaction(GetPlayerLeader(playerid))){
  6.         new Faction;
  7.         new gftext[255];
  8.         if(!sscanf(params,"d",Faction)){
  9.             if(IsAFightFaction(Faction)){
  10.                 new Warfaction = GetPlayerLeader(playerid);
  11.                 if(Faction == Warfaction)
  12.                     return SendClientMessage(playerid,WAR_COL_GREY,"Sich selber anzugreifen wäre doof...");
  13.                 for(new War;War<MAX_WARS;War++){
  14.                     if(WarInfo[Faction][War] == Warfaction)
  15.                         return SendClientMessage(playerid,WAR_COL_GREY,"Ihr habt bereits ein Krieg mit der gewählten Fraktion.");
  16.                 }
  17.                 for(new War;War<MAX_WARS;War++)
  18.                 {
  19.                     if(WarInfo[Warfaction][War] == Faction)
  20.                         return SendClientMessage(playerid,WAR_COL_GREY,"Ihr habt bereits ein Krieg mit der gewählten Fraktion.");
  21.                 }
  22.                 for(new War;War<MAX_WARS;War++){
  23.                     if(!WarInfo[Warfaction][War]){
  24.                         WarInfo[Warfaction][War] = Faction;
  25.                         format(gftext,sizeof(gftext),"%s hat euch den Krieg erklärt.",GetFactionNameOfFaction(Warfaction));
  26.                         for(new i;i<GetMaxPlayers();i++){
  27.                             if(IsPlayerConnected(i)){
  28.                                 if(GetPlayerFaction(i) == Faction)
  29.                                     SendClientMessage(i,COLOR_RED,gftext);
  30.  
  31.                             }
  32.                         }
  33.                         format(gftext,sizeof(gftext),"Ihr habt nun Krieg mit %s.und musst 250.000$ Bezahlen.",GetFactionNameOfFaction(Faction));
  34.                         GivePlayerMoney(playerid, -250000);
  35.                         for(new i;i<GetMaxPlayers();i++)
  36.                         {
  37.                             if(IsPlayerConnected(i))
  38.                             {
  39.                                 if(GetPlayerFaction(i) == Warfaction)
  40.                                 SendClientMessage(i,COLOR_RED,gftext);
  41.                             }
  42.                         }
  43.                         SaveWars();
  44.                         return true;
  45.                     }
  46.                 }
  47.                 SendClientMessage(playerid,WAR_COL_GREY,"Ihr habt zu viele Kriege ...");
  48.             }else{
  49.                 SendClientMessage(playerid,WAR_COL_GREY,"Fehler, falsche Fraktion!");
  50.                 SendClientMessage(playerid,WAR_COL_GREY,"Verfügbare Fraktionen:");
  51.                 for(new FACTION;FACTION<MAX_FACTIONS;FACTION++){
  52.                     if(IsAFightFaction(FACTION)){
  53.                         format(gftext,sizeof(gftext),"|- %d = %s",FACTION,GetFactionNameOfFaction(FACTION));
  54.                         SendClientMessage(playerid,WAR_COL_GREY,gftext);
  55.                     }
  56.                 }
  57.             }
  58.         }
  59.         else
  60.         {
  61.             SendClientMessage(playerid,WAR_COL_GREY,"Fehler, benutze: '/Startwar [Fraktion]'");
  62.             SendClientMessage(playerid,WAR_COL_GREY,"Verfügbare Fraktionen:");
  63.             for(new FACTION;FACTION<MAX_FACTIONS;FACTION++){
  64.                 if(IsAFightFaction(FACTION)){
  65.                     format(gftext,sizeof(gftext),"|- %d = %s",FACTION,GetFactionNameOfFaction(FACTION));
  66.                     SendClientMessage(playerid,WAR_COL_GREY,gftext);
  67.                 }
  68.             }
  69.         }
  70.     }else SendClientMessage(playerid,WAR_COL_GREY,"Das darfst du nicht!");
  71.     return true;
  72. }
  73.  
  74.  
  75. /createhouse
  76. if(!strcmp(cmd, "/createhouse", true))
  77.     {
  78.         if(PlayerInfo[playerid][pAdmin] >= 7)
  79.         {
  80.             tmp = strtok(cmdtext, idx);
  81.             if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD1, "/CreateHouse [Preis] [Interior Typ ( /interiors )]");
  82.             new housepreis = strval(tmp);
  83.             tmp = strtok(cmdtext, idx);
  84.             if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD1, "/CreateHouse [Preis] [Interior Typ ( /interiors )]");
  85.             new inttype = strval(tmp);
  86.             if(inttype < 1 || inttype > sizeof(Interiors)) return SendClientMessage(playerid, COLOR_GRAD1, "Ungültige Interior Typ ID! /interiors");
  87.             inttype -= 1;
  88.             new i = GetHouseID(); if(i == -1) return SendClientMessage(playerid, COLOR_GRAD1, "Es kann kein weiters Haus mehr erstellt werden! ( MAX_HOUSES erhöhen )");
  89.             format(str, sizeof str, "/Houses/%d.ini", i);
  90.             dini_Create(str);
  91.             HouseInfo[i][hEntrx] = GetX(playerid);
  92.             HouseInfo[i][hEntry] = GetY(playerid);
  93.             HouseInfo[i][hEntrz] = GetZ(playerid);
  94.             HouseInfo[i][hInt] = Interiors[inttype][interiorid];
  95.             HouseInfo[i][hIntx] = Interiors[inttype][intpx];
  96.             HouseInfo[i][hInty] = Interiors[inttype][intpy];
  97.             HouseInfo[i][hIntz] = Interiors[inttype][intpz];
  98.             HouseInfo[i][hIntid] = inttype;
  99.             HouseInfo[i][hPrice] = housepreis;
  100.             HouseInfo[i][hRentable] = 0;
  101.             HouseInfo[i][hRent] = 50;
  102.             HouseInfo[i][hOwned] = 0;
  103.             format(HouseInfo[i][hOwner], MAX_PLAYER_NAME, "-");
  104.             format(HouseInfo[i][hDescr], 50, "%s", Interiors[inttype][description]);
  105.             format(str, sizeof str, "Dieses Haus steht zum verkauf!\nBeschreibung: %s\nPreis: $%d\nZum kaufen gib /buyhouse ein", HouseInfo[i][hDescr], HouseInfo[i][hPrice]);
  106.             HouseInfo[i][hLabel] = Create3DTextLabel(str, COLOR_HOUSELABEL, HouseInfo[i][hEntrx], HouseInfo[i][hEntry], HouseInfo[i][hEntrz], 20);
  107.             HouseInfo[i][hPick] = CreatePickup(1273, 1, HouseInfo[i][hEntrx], HouseInfo[i][hEntry], HouseInfo[i][hEntrz]);
  108.             SendClientMessage(playerid, COLOR_GRAD1, "Haus erstellt!");
  109.             SaveHouse(i);
  110.             return 1;
  111.         }
  112.         return 1;
  113.     }
Advertisement
Add Comment
Please, Sign In to add comment