Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /startwar
- dcmd_startwar(playerid,params[])
- {
- if(IsAFightFaction(GetPlayerLeader(playerid))){
- new Faction;
- new gftext[255];
- if(!sscanf(params,"d",Faction)){
- if(IsAFightFaction(Faction)){
- new Warfaction = GetPlayerLeader(playerid);
- if(Faction == Warfaction)
- return SendClientMessage(playerid,WAR_COL_GREY,"Sich selber anzugreifen wäre doof...");
- for(new War;War<MAX_WARS;War++){
- if(WarInfo[Faction][War] == Warfaction)
- return SendClientMessage(playerid,WAR_COL_GREY,"Ihr habt bereits ein Krieg mit der gewählten Fraktion.");
- }
- for(new War;War<MAX_WARS;War++)
- {
- if(WarInfo[Warfaction][War] == Faction)
- return SendClientMessage(playerid,WAR_COL_GREY,"Ihr habt bereits ein Krieg mit der gewählten Fraktion.");
- }
- for(new War;War<MAX_WARS;War++){
- if(!WarInfo[Warfaction][War]){
- WarInfo[Warfaction][War] = Faction;
- format(gftext,sizeof(gftext),"%s hat euch den Krieg erklärt.",GetFactionNameOfFaction(Warfaction));
- for(new i;i<GetMaxPlayers();i++){
- if(IsPlayerConnected(i)){
- if(GetPlayerFaction(i) == Faction)
- SendClientMessage(i,COLOR_RED,gftext);
- }
- }
- format(gftext,sizeof(gftext),"Ihr habt nun Krieg mit %s.und musst 250.000$ Bezahlen.",GetFactionNameOfFaction(Faction));
- GivePlayerMoney(playerid, -250000);
- for(new i;i<GetMaxPlayers();i++)
- {
- if(IsPlayerConnected(i))
- {
- if(GetPlayerFaction(i) == Warfaction)
- SendClientMessage(i,COLOR_RED,gftext);
- }
- }
- SaveWars();
- return true;
- }
- }
- SendClientMessage(playerid,WAR_COL_GREY,"Ihr habt zu viele Kriege ...");
- }else{
- SendClientMessage(playerid,WAR_COL_GREY,"Fehler, falsche Fraktion!");
- SendClientMessage(playerid,WAR_COL_GREY,"Verfügbare Fraktionen:");
- for(new FACTION;FACTION<MAX_FACTIONS;FACTION++){
- if(IsAFightFaction(FACTION)){
- format(gftext,sizeof(gftext),"|- %d = %s",FACTION,GetFactionNameOfFaction(FACTION));
- SendClientMessage(playerid,WAR_COL_GREY,gftext);
- }
- }
- }
- }
- else
- {
- SendClientMessage(playerid,WAR_COL_GREY,"Fehler, benutze: '/Startwar [Fraktion]'");
- SendClientMessage(playerid,WAR_COL_GREY,"Verfügbare Fraktionen:");
- for(new FACTION;FACTION<MAX_FACTIONS;FACTION++){
- if(IsAFightFaction(FACTION)){
- format(gftext,sizeof(gftext),"|- %d = %s",FACTION,GetFactionNameOfFaction(FACTION));
- SendClientMessage(playerid,WAR_COL_GREY,gftext);
- }
- }
- }
- }else SendClientMessage(playerid,WAR_COL_GREY,"Das darfst du nicht!");
- return true;
- }
- /createhouse
- if(!strcmp(cmd, "/createhouse", true))
- {
- if(PlayerInfo[playerid][pAdmin] >= 7)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD1, "/CreateHouse [Preis] [Interior Typ ( /interiors )]");
- new housepreis = strval(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD1, "/CreateHouse [Preis] [Interior Typ ( /interiors )]");
- new inttype = strval(tmp);
- if(inttype < 1 || inttype > sizeof(Interiors)) return SendClientMessage(playerid, COLOR_GRAD1, "Ungültige Interior Typ ID! /interiors");
- inttype -= 1;
- new i = GetHouseID(); if(i == -1) return SendClientMessage(playerid, COLOR_GRAD1, "Es kann kein weiters Haus mehr erstellt werden! ( MAX_HOUSES erhöhen )");
- format(str, sizeof str, "/Houses/%d.ini", i);
- dini_Create(str);
- HouseInfo[i][hEntrx] = GetX(playerid);
- HouseInfo[i][hEntry] = GetY(playerid);
- HouseInfo[i][hEntrz] = GetZ(playerid);
- HouseInfo[i][hInt] = Interiors[inttype][interiorid];
- HouseInfo[i][hIntx] = Interiors[inttype][intpx];
- HouseInfo[i][hInty] = Interiors[inttype][intpy];
- HouseInfo[i][hIntz] = Interiors[inttype][intpz];
- HouseInfo[i][hIntid] = inttype;
- HouseInfo[i][hPrice] = housepreis;
- HouseInfo[i][hRentable] = 0;
- HouseInfo[i][hRent] = 50;
- HouseInfo[i][hOwned] = 0;
- format(HouseInfo[i][hOwner], MAX_PLAYER_NAME, "-");
- format(HouseInfo[i][hDescr], 50, "%s", Interiors[inttype][description]);
- format(str, sizeof str, "Dieses Haus steht zum verkauf!\nBeschreibung: %s\nPreis: $%d\nZum kaufen gib /buyhouse ein", HouseInfo[i][hDescr], HouseInfo[i][hPrice]);
- HouseInfo[i][hLabel] = Create3DTextLabel(str, COLOR_HOUSELABEL, HouseInfo[i][hEntrx], HouseInfo[i][hEntry], HouseInfo[i][hEntrz], 20);
- HouseInfo[i][hPick] = CreatePickup(1273, 1, HouseInfo[i][hEntrx], HouseInfo[i][hEntry], HouseInfo[i][hEntrz]);
- SendClientMessage(playerid, COLOR_GRAD1, "Haus erstellt!");
- SaveHouse(i);
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment