Hallo liebe Com,
ich bräuchte dringend Hilfe da ich den Befehl /flagge nichtmehr eingeben will. D.H ich wollte es so machen, dass wenn ich zu der Flagge laufe automatisch die Flagge bekomme..
Hier der Flaggenbefehl:
if(!strcmp("/Flagge",cmdtext,true))
{
if(IsAFightFaction(GetPlayerFaction(playerid)))
{
new TempZone = GetPlayerFightzone(playerid);
if(TempZone != -255)
{
if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT)
return SendClientMessage(playerid,FS_COL_GREY,"Du darfst das nur zu Fuß machen ...");
if(FightSystem[TempZone][fsAttackFaction] == -255 || !FightSystem[TempZone][fsFightTime])
return SendClientMessage(playerid,FS_COL_GREY,"Hier gibt es nichts zu erobern.");
if(FightSystem[TempZone][fsOwnerFaction] == GetPlayerFaction(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,5.0,FightSystem[TempZone][fsCtfOfAttackx],FightSystem[TempZone][fsCtfOfAttacky],FightSystem[TempZone][fsCtfOfAttackz]))
{
if(FightSystem[TempZone][fsCtfOfAttack][0] != -255)
return SendClientMessage(playerid,FS_COL_GREY,"Deine Gang / Mafia erobert bereits die Flagge!");
FightSystem[TempZone][fsCtfOfAttack][1] = 0;
FightSystem[TempZone][fsCtfOfAttack][0] = playerid;
AttachObjectToPlayer(FightSystem[TempZone][fsFlagOfAttack],playerid,0.0,0.0,0.0,0.0,0.0,0.0);
new fsName[MAX_PLAYER_NAME];
GetPlayerName(playerid,fsName,MAX_PLAYER_NAME);
new fsText[128];
format(fsText,sizeof(fsText),">>> Gangfight <<< | %s hat die Flagge aufgehoben!",fsName);
for(new i;i<MAX_PLAYERS;i++){
if(IsPlayerConnected(i)){
if(GetPlayerFaction(i) == FightSystem[TempZone][fsOwnerFaction] || GetPlayerFaction(i) == FightSystem[TempZone][fsAttackFaction]){
PlayerPlaySound(i,1058,0.0,0.0,0.0);
SendClientMessage(i,FS_COL_YELLOW,fsText);
}
}
}
}else SendClientMessage(playerid,FS_COL_GREY,"Du bist nicht in der nähe der Flagge!");
}
else if(FightSystem[TempZone][fsAttackFaction] == GetPlayerFaction(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,5.0,FightSystem[TempZone][fsCtfOfOwnerx],FightSystem[TempZone][fsCtfOfOwnery],FightSystem[TempZone][fsCtfOfOwnerz]))
{
if(FightSystem[TempZone][fsCtfOfOwner][0] != -255)
return SendClientMessage(playerid,FS_COL_GREY,"Deine Gang / Mafia erobert bereits die Flagge!");
FightSystem[TempZone][fsCtfOfOwner][1] = 0;
FightSystem[TempZone][fsCtfOfOwner][0] = playerid;
AttachObjectToPlayer(FightSystem[TempZone][fsFlagOfOwner],playerid,0.0,0.0,0.0,0.0,0.0,0.0);
new fsName[MAX_PLAYER_NAME];
GetPlayerName(playerid,fsName,MAX_PLAYER_NAME);
new fsText[128];
format(fsText,sizeof(fsText),">>> Gangfight <<< | %s hat die Flagge aufgehoben!",fsName);
for(new i;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerFaction(i) == FightSystem[TempZone][fsOwnerFaction] || GetPlayerFaction(i) == FightSystem[TempZone][fsAttackFaction])
{
PlayerPlaySound(i,1058,0.0,0.0,0.0);
SendClientMessage(i,FS_COL_YELLOW,fsText);
}
}
}
}else SendClientMessage(playerid,FS_COL_GREY,"Du bist nicht in der nähe der Flagge!");
}else SendClientMessage(playerid,FS_COL_GREY,"Du bist nicht in diesem Fight verwickelt ...");
}else SendClientMessage(playerid,FS_COL_GREY,"Du bist in keinem Gebiet!");
}else SendClientMessage(playerid,FS_COL_GREY,"Du bist in keiner Gang / Mafia.");
return 1;
}
Und hier mein verbuggtes bzw nichtfunktionierender Befehl..
public OnPlayerPickUpPickup(playerid,pickupid)
{
//Gangwarsystem
if(IsAFightFaction(GetPlayerFaction(playerid)))
{
new TempZone = GetPlayerFightzone(playerid);
if(TempZone != -255)
{
if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT)
return SendClientMessage(playerid,GRAU,"Du darfst das nur zu Fuß machen ...");
if(GangwarZones[TempZone][fsAttackFaction] == -255 || !GangwarZones[TempZone][fsFightTime])
return SendClientMessage(playerid,GRAU,"Hier gibt es nichts zu erobern.");
if(GangwarZones[TempZone][fsOwnerFaction] == GetPlayerFaction(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,5.0,GangwarZones[TempZone][fsCtfOfAttackx],GangwarZones[TempZone][fsCtfOfAttacky],GangwarZones[TempZone][fsCtfOfAttackz]))
{
if(GangwarZones[TempZone][fsCtfOfAttack][0] != -255)
return SendClientMessage(playerid,GRAU,"Deine Gang / Mafia erobert bereits die Flagge!");
GangwarZones[TempZone][fsCtfOfAttack][1] = 0;
GangwarZones[TempZone][fsCtfOfAttack][0] = playerid;
AttachObjectToPlayer(GangwarZones[TempZone][fsFlagOfAttack],playerid,0.0,0.0,0.0,0.0,0.0,0.0);
new fsName[MAX_PLAYER_NAME];
GetPlayerName(playerid,fsName,MAX_PLAYER_NAME);
new fsText[128];
format(fsText,sizeof(fsText),">>> Gangfight <<< | %s hat die Flagge aufgehoben!",fsName);
for(new i;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerFaction(i) == GangwarZones[TempZone][fsOwnerFaction] || GetPlayerFaction(i) == GangwarZones[TempZone][fsAttackFaction])
{
PlayerPlaySound(i,1058,0.0,0.0,0.0);
SendClientMessage(i,GW_COLOR_ORANGE,fsText);
}
}
}
}else SendClientMessage(playerid,GRAU,"Du bist nicht in der nähe der Flagge!");
}
else if(GangwarZones[TempZone][fsAttackFaction] == GetPlayerFaction(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,5.0,GangwarZones[TempZone][fsCtfOfOwnerx],GangwarZones[TempZone][fsCtfOfOwnery],GangwarZones[TempZone][fsCtfOfOwnerz]))
{
if(GangwarZones[TempZone][fsCtfOfOwner][0] != -255)
return SendClientMessage(playerid,GRAU,"Deine Gang / Mafia erobert bereits die Flagge!");
GangwarZones[TempZone][fsCtfOfOwner][1] = 0;
GangwarZones[TempZone][fsCtfOfOwner][0] = playerid;
AttachObjectToPlayer(GangwarZones[TempZone][fsFlagOfOwner],playerid,0.0,0.0,0.0,0.0,0.0,0.0);
new fsName[MAX_PLAYER_NAME];
GetPlayerName(playerid,fsName,MAX_PLAYER_NAME);
new fsText[128];
format(fsText,sizeof(fsText),">>> Gangfight <<< | %s hat die Flagge aufgehoben!",fsName);
for(new i;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerFaction(i) == GangwarZones[TempZone][fsOwnerFaction] || GetPlayerFaction(i) == GangwarZones[TempZone][fsAttackFaction])
{
PlayerPlaySound(i,1058,0.0,0.0,0.0);
SendClientMessage(i,GW_COLOR_ORANGE,fsText);
}
}
}
}else SendClientMessage(playerid,GRAU,"Du bist nicht in der nähe der Flagge!");
}else SendClientMessage(playerid,GRAU,"Du bist nicht in diesem Fight verwickelt ...");
}return 1;
}else SendClientMessage(playerid,GRAU,"Du bist in keiner Gang / Mafia.");
Bitte um dringende Hilfe! ![crying ;(](https://breadfish.de/wcf/images/smilies/emojione/1f62d.png)