Hallo Hallo leute ich komm einfach net weiter ich brauche nen befehl um mein gang war system zu starten schon alles definiert usw .....
// OnPlayerDeath
// ========== gang zones =======
if(gTeam[killerid] != gTeam[playerid])
{
new Float:x, Float:y, Float:z; GetPlayerPos(playerid,x,y,z);
for(new zone = 0; zone < MAX_ZONES; zone++)
{
if(x >= ZoneLocations[zone][0] && x < ZoneLocations[zone][2] && y >= ZoneLocations[zone][1] && y < ZoneLocations[zone][3])
{
// The Killer who kills on his own turf
if( ZoneInfo[ zone ][ZoneOwnerID] == gTeam[killerid] )
{
if(ZoneInfo[zone][GangWarInProgress] == 1)
{
if(gTeam[playerid] == ZoneInfo[zone][ZoneAttackers]) GangInfo[ gTeam[killerid] ][DefendCount]++;
if( GangInfo[ gTeam[killerid] ][DefendCount] == GANGAREA_DEFEND )
{
KillTimer( GangWarTimer[zone] );//kill timer
SendClientMessageToAll(COLOR_RED," "); GetPlayerName(killerid, str, sizeof(str));
format(str, sizeof(str), "*** GangZonen Nachricht: %s von %s hat sein Ganggebiet vor %s geschützt", str,GangInfo[ gTeam[killerid] ][GangName], GangInfo[ gTeam[playerid] ][GangName] );
SendClientMessageToAll(GetPlayerColor(killerid), str); SendClientMessageToAll(COLOR_RED," ");
GangZoneStopFlashForAll( zone );// change the zone colour
GangZoneHideForAll( zone );
GangZoneShowForAll( zone, GetPlayerColor(killerid) );
GangInfo[ gTeam[killerid] ][UnderAttackCount] = 0;// reset the counters
GangInfo[ gTeam[playerid] ][UnderAttackCount] = 0;
GangInfo[ gTeam[killerid] ][DefendCount] = 0;
ZoneInfo[zone][GangWarInProgress] = 0;
ZoneInfo[zone][ZoneAttackers] = -1;
GangZone_CurrentColour[ zone ] = GetPlayerColor(killerid);// save the current zone colour for new players to see DONT REALLY NEED ALL THIS AGAIN
strmid(ZoneInfo[ zone ][ZoneOwner], GangInfo[ gTeam[killerid] ][GangName], 0, strlen(GangInfo[ gTeam[killerid] ][GangName]), MAX_PLAYER_NAME);
ZoneInfo[ zone ][ZoneOwnerID] = gTeam[killerid]; // save the 'new' owner of the zone
SaveZones();// Save to file
}
}
}
// The Player who dies on his own turf
else if( ZoneInfo[ zone ][ZoneOwnerID] == gTeam[playerid] )
{
GangInfo[ gTeam[playerid] ][UnderAttackCount]++;
// start the gang war
if(GangInfo[ gTeam[playerid] ][UnderAttackCount] == GANGAREA_WARNINGS)
{
SendClientMessageToAll(COLOR_RED," "); GetPlayerName(killerid, str, sizeof(str));
format(str, sizeof(str), "*** GangZonen Nachricht: %s von %s hat einen Gang-Krieg mit %s gestartet ", str,GangInfo[ gTeam[killerid] ][GangName], GangInfo[ gTeam[playerid] ][GangName] );
SendClientMessageToAll(GetPlayerColor(killerid), str); SendClientMessageToAll(COLOR_RED," ");
GangZoneFlashForAll(zone, GetPlayerColor(killerid) );
ZoneInfo[zone][GangWarInProgress] = 1;
ZoneInfo[zone][ZoneAttackers] = gTeam[killerid];
// If after x minutes the zone isnt taken then the defending gang keep their turf
GangWarTimer[zone] = SetTimerEx("EndGangWar",GANGWAR_LENGTH,false,"iii",zone, gTeam[killerid], gTeam[playerid] );
return 1;
}
// Gang has taken the other gangs turf
if( (GangInfo[ gTeam[playerid] ][UnderAttackCount] == GANGAREA_TAKE) && (ZoneInfo[zone][ZoneAttackers] == gTeam[killerid]) )
{
KillTimer( GangWarTimer[zone] );// kill the end gangwar timer
SendClientMessageToAll(COLOR_RED," "); GetPlayerName(killerid, str, sizeof(str));
format(str, sizeof(str), "*** GangZonen Nachricht: %s von %s hat %s eingenommen", str,GangInfo[ gTeam[killerid] ][GangName], GangInfo[ gTeam[playerid] ][GangName] );
SendClientMessageToAll(GetPlayerColor(killerid), str); SendClientMessageToAll(COLOR_RED," ");
format(str, sizeof(str), "~n~~n~~n~~n~~n~~n~~n~~n~~n~ %s hat~n~ %s eingenommen",GangInfo[ gTeam[killerid] ][GangName], GangInfo[ gTeam[playerid] ][GangName] );
GameTextForAll(str,3000,3);
GangZoneStopFlashForAll( zone );// change the zone colour
GangZoneHideForAll( zone );
GangZoneShowForAll( zone, GetPlayerColor(killerid) );
GangInfo[ gTeam[killerid] ][UnderAttackCount] = 0; // reset the counter
GangInfo[ gTeam[playerid] ][UnderAttackCount] = 0;
GangInfo[ gTeam[killerid] ][DefendCount] = 0;
ZoneInfo[zone][GangWarInProgress] = 0;
ZoneInfo[zone][ZoneAttackers] = -1;
GangZone_CurrentColour[ zone ] = GetPlayerColor(killerid);// save the current zone colour for new players to see
strmid(ZoneInfo[ zone ][ZoneOwner], GangInfo[ gTeam[killerid] ][GangName], 0, strlen(GangInfo[ gTeam[killerid] ][GangName]), MAX_PLAYER_NAME);
ZoneInfo[ zone ][ZoneOwnerID] = gTeam[killerid]; // save the new owner of the zone
SaveZones();//save zones to file
}
}
}
}
}
// habs mal so getestet kommt aber unknow command
if(strcmp(cmdtext, "/gangwarestart", true) == 0)
{
//if(GangInfo[ gTeam[playerid] ][UnderAttackCount] == GANGAREA_WARNINGS)
for(new zone = 0; zone < MAX_ZONES; zone++)
{
SendClientMessageToAll(COLOR_RED," "); GetPlayerName(killerid, str, sizeof(str));
format(str, sizeof(str), "*** GangZonen Nachricht: %s von %s hat einen Gang-Krieg mit %s gestartet ", str,GangInfo[ gTeam[killerid] ][GangName], GangInfo[ gTeam[playerid] ][GangName] );
SendClientMessageToAll(GetPlayerColor(killerid), str); SendClientMessageToAll(COLOR_RED," ");
GangZoneFlashForAll(zone, GetPlayerColor(killerid) );
ZoneInfo[zone][GangWarInProgress] = 1;
ZoneInfo[zone][ZoneAttackers] = gTeam[killerid];
// If after x minutes the zone isnt taken then the defending gang keep their turf
GangWarTimer[zone] = SetTimerEx("EndGangWar",GANGWAR_LENGTH,false,"iii",zone, gTeam[killerid], gTeam[playerid] );
{
return 1;
}
}
}