if(GangZoneWait == 1)
{
if(GangZoneWaitTime <= 0)
{
GangZoneWait = 0;
GangZoneWaitTime = 0;
if(AcceptedGangWar == 1)
{
SendRadioMessage(AttackerGang, COLOR_LIGHTRED, "* Das GangWar hat gestartet.");
SendRadioMessage(DefenderGang, COLOR_LIGHTRED, "* Das GangWar hat gestartet.");
GangZoneWar = 1;
gangzone = SetTimer("AttackGangZone", 1000,1);
for(new player = 0; player < MAX_PLAYERS; player++)
{
if(IsPlayerConnected(player))
{
if(GangWarMember[player] == 1 || GangWarMember[player] == 2)
{
TogglePlayerControllable(player, 1);
TextDrawShowForPlayer(player, gkills[player]);
TextDrawShowForPlayer(player, gpoints[player]);
}
}
}
}
else
{
for(new a = 0; a < MAX_PLAYERS; a++)
{
if(IsPlayerConnected(a))
{
if(GangWarMember[a] == 1)
{
TogglePlayerControllable(a, 1);
GangWarEnd(a, Invade[a]);
}
}
}
}
}Ist das Richtig?Und ist das hier:
gangzone = SetTimer("AttackGangZone", 1000,1);
Also 1 Sekunde die Einnahme Zeit^^?
/invade Time
- Sergej
- Geschlossen
- Erledigt
-
-
Das hätte ich gerne ... GangWarEnd
-
forward GangWarEnd(playerid, gangzoneid);
public GangWarEnd(playerid, gangzoneid)
{
if(GangZoneInfo[gangzoneid][zGang] == 5)
{
GangZones[0]--;
}
if(GangZoneInfo[gangzoneid][zGang] == 6)
{
GangZones[1]--;
}
if(GangZoneInfo[gangzoneid][zGang] == 12)
{
GangZones[2]--;
}
if(GangZoneInfo[gangzoneid][zGang] == 13)
{
GangZones[3]--;
}
GangZoneInfo[gangzoneid][zGang] = GetPlayerGang(playerid);
new gangstring[60];
if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)
{
format(gangstring, sizeof(gangstring), "La Cosa Nostra");
GangZones[0] ++;
}
if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)
{
format(gangstring, sizeof(gangstring), "Ballas");
GangZones[1] ++;
}
if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12)
{
format(gangstring, sizeof(gangstring), "Grove Street Family");
GangZones[2] ++;
}
if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
{
format(gangstring, sizeof(gangstring), "Yakuza");
GangZones[3] ++;
}
strmid(GangZoneInfo[gangzoneid][zOwner], gangstring, 0, strlen(gangstring), 255);
UpdateGangZone(gangzoneid);
GangSafeInfo[GetPlayerGangSafeInfo(playerid)-1][sMoney] += GangZoneInfo[gangzoneid][zMoney];
for(new g = 0; g < MAX_PLAYERS; g++)
{
if(IsAMember(g))
{
new rtext[64];
if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5) { rtext = "L.C.N."; }
if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6) { rtext = "Ballas"; }
if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12) { rtext = "Grove Street Family"; }
if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13) { rtext = "Yakuza"; }
new string2[256];
format(string2, sizeof(string2), "~y~Gang Zone Nr. %d gehoert nun der ~r~%s", GangZoneInfo[gangzoneid][zID],rtext);
GameTextForPlayer(g, string2,5000, 4);
}
}
GangZoneStopFlashForAll(gangzoneid);
GangZoneInfo[gangzoneid][zOwned] = 1;
GangZoneInfo[gangzoneid][zAttackAgain] = 1;
OnGangZoneUpdate();
GangZoneWar = 0;
AttackedGangZone = 255;
GangZoneWait = 0;
GangZoneWaitTime = 0;
AttackerGang = 255;
DefenderGang = 255;
GangSafeInfo[GetPlayerGangSafeInfo(playerid)-1][sKills] = 0;
GangSafeInfo[GetPlayerGangSafeInfo(playerid)-1][sPoints] = 0;
KillTimer(gangzone);
SaveStuff();
Attackers = 0;
Defenders = 0;
MaxGangWarTime = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(Invade[i] != 255)
{
GangWarMember[i] = 0;
Invade[i] = 255;
SetPlayerVirtualWorld(i, 0);
GangWarDeath[i] = 0;
GangWarDeathTime[i] = 0;
SpawnPlayer(i);
}
if(GangWarMember[i] == 1)
{
GangWarMember[i] = 0;
Invade[i] = 255;
SetPlayerVirtualWorld(i, 0);
GangWarDeath[i] = 0;
GangWarDeathTime[i] = 0;
SpawnPlayer(i);
}
if(GangWarMember[i] == 2)
{
GangWarMember[i] = 0;
Invade[i] = 255;
SetPlayerVirtualWorld(i, 0);
GangWarDeath[i] = 0;
GangWarDeathTime[i] = 0;
SpawnPlayer(i);
}
else
{
GangWarMember[i] = 0;
Invade[i] = 255;
SetPlayerVirtualWorld(i, 0);
GangWarDeath[i] = 0;
GangWarDeathTime[i] = 0;
}
}
}
} -
GangSafeInfo[GetPlayerGangSafeInfo(playerid)-1][sMoney] += GangZoneInfo[gangzoneid][zMoney];
-
Also was es schon drine? Hinter das Plus die gewünschte Summe?
Andere Frage, denke auch die letzte wen das geklärt ist.
gangzone = SetTimer("AttackGangZone", 1000,1);
Also 1 Sekunde die Einnahme Zeit? -
Muss ich den public "AttackGangZone" sehen...
-
public AttackGangZone()
{
new AttackerID, DefenderID, string[256];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(Invade[i] != 255)
{
format(string, sizeof(string), "Kills: ~r~%d",GangSafeInfo[GetPlayerGangSafeInfo(i)-1][sKills]);
TextDrawSetString(gkills[i], string);
format(string, sizeof(string), "Punkte: ~g~%d",GangSafeInfo[GetPlayerGangSafeInfo(i)-1][sPoints]);
TextDrawSetString(gpoints[i], string);
pointtimer ++;
if(pointtimer == 30)
{
if(PlayerInfo[i][pMember] == AttackerGang || PlayerInfo[i][pLeader] == AttackerGang)
{
GangSafeInfo[GetPlayerGangSafeInfo(i)-1][sPoints] += Attackers;
}
if(PlayerInfo[i][pMember] == DefenderGang || PlayerInfo[i][pLeader] == DefenderGang)
{
GangSafeInfo[GetPlayerGangSafeInfo(i)-1][sPoints] += Defenders;
}
format(string, sizeof(string), "Kills: ~r~%d",GangSafeInfo[GetPlayerGangSafeInfo(i)-1][sKills]);
TextDrawSetString(gkills[i], string);
format(string, sizeof(string), "Punkte: ~g~%d",GangSafeInfo[GetPlayerGangSafeInfo(i)-1][sPoints]);
TextDrawSetString(gpoints[i], string);
pointtimer = 0;
}
if(GangSafeInfo[GetPlayerGangSafeInfo(i)-1][sPoints] >= 150)
{
GangWarEnd(i, Invade[i]);
}
if(PlayerInfo[i][pMember] == AttackerGang || PlayerInfo[i][pLeader] == AttackerGang)
{
if(IsPlayerInRangeOfPoint(i,15.0, GangZoneInfo[Invade[i]][zSpawn1X], GangZoneInfo[Invade[i]][zSpawn1Y], GangZoneInfo[Invade[i]][zSpawn1Z]))
{
SpawnCampingTime[i] ++;
if(SpawnCampingTime[i] == 15)
{
SendClientMessage(i, COLOR_LIGHTBLUE, "* Du befindest dich im eigenen Spawngebiet, verlasse es.");
}
if(SpawnCampingTime[i] == 18)
{
SendClientMessage(i, COLOR_LIGHTBLUE, "* Du befindest dich im eigenen Spawngebiet, verlasse es.");
}
if(SpawnCampingTime[i] == 20)
{
SendClientMessage(i, COLOR_LIGHTBLUE, "* Du befindest dich im eigenen Spawngebiet, verlasse es.");
GangSafeInfo[GetPlayerGangSafeInfo(i)-1][sPoints] --;
}
if(SpawnCampingTime[i] == 25)
{
SendClientMessage(i, COLOR_LIGHTBLUE, "* Du befindest dich im eigenen Spawngebiet, verlasse es.");
GangSafeInfo[GetPlayerGangSafeInfo(i)-1][sPoints] --;
}
if(SpawnCampingTime[i] >= 30)
{
SendClientMessage(i, COLOR_LIGHTBLUE, "* Du befindest dich im eigenen Spawngebiet, verlasse es.");
GangSafeInfo[GetPlayerGangSafeInfo(i)-1][sPoints] --;
}
}
else if(IsPlayerInRangeOfPoint(i,15.0, GangZoneInfo[Invade[i]][zSpawn2X], GangZoneInfo[Invade[i]][zSpawn2Y], GangZoneInfo[Invade[i]][zSpawn2Z]))
{
SpawnCampingTime[i] ++;
if(SpawnCampingTime[i] == 3)
{
SendClientMessage(i, COLOR_LIGHTBLUE, "* Du befindest dich im feindlichen Spawngebiet, verlasse es.");
}
if(SpawnCampingTime[i] == 6)
{
SendClientMessage(i, COLOR_LIGHTBLUE, "* Du befindest dich im feindlichen Spawngebiet, verlasse es.");
}
if(SpawnCampingTime[i] == 9)
{
SendClientMessage(i, COLOR_LIGHTBLUE, "* Du befindest dich im feindlichen Spawngebiet, verlasse es.");
GangSafeInfo[GetPlayerGangSafeInfo(i)-1][sPoints] --;
}
if(SpawnCampingTime[i] == 12)
{
SendClientMessage(i, COLOR_LIGHTBLUE, "* Du befindest dich im feindlichen Spawngebiet, verlasse es.");
GangSafeInfo[GetPlayerGangSafeInfo(i)-1][sPoints] --;
}
if(SpawnCampingTime[i] >= 15)
{
SendClientMessage(i, COLOR_LIGHTBLUE, "* Du befindest dich im feindlichen Spawngebiet, verlasse es.");
GangSafeInfo[GetPlayerGangSafeInfo(i)-1][sPoints] --;
}
}
else SpawnCampingTime[i] = 0;
}
if(PlayerInfo[i][pMember] == DefenderGang || PlayerInfo[i][pLeader] == DefenderGang)
{
if(IsPlayerInRangeOfPoint(i,15.0, GangZoneInfo[Invade[i]][zSpawn2X], GangZoneInfo[Invade[i]][zSpawn2Y], GangZoneInfo[Invade[i]][zSpawn2Z]))
{
SpawnCampingTime[i] ++;
if(SpawnCampingTime[i] == 15)
{
SendClientMessage(i, COLOR_LIGHTBLUE, "* Du befindest dich im eigenen Spawngebiet, verlasse es.");
}
if(SpawnCampingTime[i] == 18)
{
SendClientMessage(i, COLOR_LIGHTBLUE, "* Du befindest dich im eigenen Spawngebiet, verlasse es.");
}
if(SpawnCampingTime[i] == 20)
{
SendClientMessage(i, COLOR_LIGHTBLUE, "* Du befindest dich im eigenen Spawngebiet, verlasse es.");
GangSafeInfo[GetPlayerGangSafeInfo(i)-1][sPoints] --;
}
if(SpawnCampingTime[i] == 25)
{
SendClientMessage(i, COLOR_LIGHTBLUE, "* Du befindest dich im eigenen Spawngebiet, verlasse es.");
GangSafeInfo[GetPlayerGangSafeInfo(i)-1][sPoints] --;
}
if(SpawnCampingTime[i] >= 30)
{
SendClientMessage(i, COLOR_LIGHTBLUE, "* Du befindest dich im eigenen Spawngebiet, verlasse es.");
GangSafeInfo[GetPlayerGangSafeInfo(i)-1][sPoints] --;
}
}
else if(IsPlayerInRangeOfPoint(i,15.0, GangZoneInfo[Invade[i]][zSpawn1X], GangZoneInfo[Invade[i]][zSpawn1Y], GangZoneInfo[Invade[i]][zSpawn1Z]))
{
SpawnCampingTime[i] ++;
if(SpawnCampingTime[i] == 3)
{
SendClientMessage(i, COLOR_LIGHTBLUE, "* Du befindest dich im feindlichen Spawngebiet, verlasse es.");
}
if(SpawnCampingTime[i] == 6)
{
SendClientMessage(i, COLOR_LIGHTBLUE, "* Du befindest dich im feindlichen Spawngebiet, verlasse es.");
}
if(SpawnCampingTime[i] == 9)
{
SendClientMessage(i, COLOR_LIGHTBLUE, "* Du befindest dich im feindlichen Spawngebiet, verlasse es.");
GangSafeInfo[GetPlayerGangSafeInfo(i)-1][sPoints] --;
}
if(SpawnCampingTime[i] == 12)
{
SendClientMessage(i, COLOR_LIGHTBLUE, "* Du befindest dich im feindlichen Spawngebiet, verlasse es.");
GangSafeInfo[GetPlayerGangSafeInfo(i)-1][sPoints] --;
}
if(SpawnCampingTime[i] >= 15)
{
SendClientMessage(i, COLOR_LIGHTBLUE, "* Du befindest dich im feindlichen Spawngebiet, verlasse es.");
GangSafeInfo[GetPlayerGangSafeInfo(i)-1][sPoints] --;
}
}
else SpawnCampingTime[i] = 0;
}
}
}
}
MaxGangWarTime++;
if(MaxGangWarTime >= 180)
{
for(new attacker = 0; attacker < MAX_PLAYERS; attacker++)
{
if(IsPlayerConnected(attacker))
{
if(PlayerInfo[attacker][pMember] == AttackerGang || PlayerInfo[attacker][pLeader] == AttackerGang)
{
AttackerID = attacker;
for(new defender = 0; defender < MAX_PLAYERS; defender++)
{
if(IsPlayerConnected(defender))
{
if(PlayerInfo[defender][pMember] == DefenderGang || PlayerInfo[attacker][pLeader] == DefenderGang)
{
DefenderID = defender;
}
}
}
}
}
}
if(GangSafeInfo[GetPlayerGangSafeInfo(DefenderID)-1][sPoints] > GangSafeInfo[GetPlayerGangSafeInfo(AttackerID)-1][sPoints])
{
GangWarEnd(DefenderID, Invade[DefenderID]);
}
if(GangSafeInfo[GetPlayerGangSafeInfo(AttackerID)-1][sPoints] > GangSafeInfo[GetPlayerGangSafeInfo(DefenderID)-1][sPoints])
{
GangWarEnd(AttackerID, Invade[AttackerID]);
}
if(GangSafeInfo[GetPlayerGangSafeInfo(AttackerID)-1][sPoints] == GangSafeInfo[GetPlayerGangSafeInfo(DefenderID)-1][sPoints])
{
GangWarEnd(DefenderID, Invade[DefenderID]);
}
}
} -
Das ist die Zeit wie lang das Gangwar geht also 180 Sekunden (2 Minuten)
-
if(MaxGangWarTime >= 180) einfach in if(MaxGangWarTime >= 6000) Für 10 Minuten.
Und wie ist das mit dem Gewinn, wen ich da die Zahl eingebe bekomme ich einen Error. Danke das du dir die mühe machst.. -
Wenn 6000 = 10 Minuten sind ja^^
Musst in Sekunden rechnen.
Und muss eh um 10 Arbeiten also von daherUnd was willst du wo ändern
-
-
GangSafeInfo[GetPlayerGangSafeInfo(playerid)-1][sMoney] += GangZoneInfo[gangzoneid][zMoney];
Hast du mir ja geschickt, war in meinem Script schon drine.
Wie mache ich jetzt das wen ich gewonnen habe 50k bar auf die Hand kriege xD -
Wem soll der Spieler den Geld bekommen... jeder ?
-
Nur der einnehmer.
-
dann übergebe mit einer variable bei invade das playerid. und lese es bei gangwarend wieder aus
-
breadfish.de
Hat das Thema geschlossen.