Guten Tag,
ich habe einen Fehler mit /invite.
Es kommt laut kumpel immer der spieler ist schon in einer Fraktion.
if(strcmp(cmd, "/invite", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutzung: /invite [playerid/Name]");
return 1;
}
new leader = PlayerInfo[playerid][pLeader];
new para1 = ReturnUser(tmp);
if (PlayerInfo[playerid][pLeader] >= 1)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if (gTeam[para1]==TEAM_GREEN && PlayerInfo[para1][pMember] == 0 && PlayerInfo[para1][pFMember] == 255)
{
if(PlayerInfo[para1][pFrakSperre] == 0 && PlayerInfo[para1][pLevel] >= 3)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
printf("AdmCmd: %s hat %s in die Fraktion %s eingeladen.", sendername, giveplayer,Fracs[leader-1]);
format(string, sizeof(string), " Du wurdest in die Fraktion %s von Leader %s eingeladen.",Fracs[leader-1], sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
SendClientMessage(para1, COLOR_GRAD2, " Um die Einladung anzunehmen: /einladung annehmen");
//SendClientMessage(para1, COLOR_GRAD2, " Um die Einladung abzulehnen: /einladung ablehnen");
format(string, sizeof(string), " Du hast %s in die Fraktion %s eingeladen.", giveplayer,Fracs[leader-1]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
SendClientMessage(playerid, COLOR_GRAD2, " Der Spieler muss nun deine Einladung annehmen oder ablehnen.");
new iyear, imonth,iday;
getdate(iyear, imonth, iday);
format(string, sizeof(string), "%s[Level:%d] wurde von %s in die Fraktion %s eingeladen (%d-%d-%d)", giveplayer,PlayerInfo[para1][pLevel],sendername,Fracs[leader-1],imonth,iday,iyear);
MemberLog(string);
Eingeladen[para1] = leader;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Dieser Spieler hat eine Fraktions-Sperre oder ist noch nicht LvL 3");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Dieser Spieler ist in einer anderen Fraktion oder bereits ein Fraktionsmitglied.");
return 1;
}
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Nur der Leader kann diesen Befehl nutzen!");
}
return 1;
}
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutzung: /invite [playerid/Name]");
return 1;
}
new leader = PlayerInfo[playerid][pLeader];
new para1 = ReturnUser(tmp);
if (PlayerInfo[playerid][pLeader] >= 1)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if (gTeam[para1]==TEAM_GREEN && PlayerInfo[para1][pMember] == 0 && PlayerInfo[para1][pFMember] == 255)
{
if(PlayerInfo[para1][pFrakSperre] == 0 && PlayerInfo[para1][pLevel] >= 3)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
printf("AdmCmd: %s hat %s in die Fraktion %s eingeladen.", sendername, giveplayer,Fracs[leader-1]);
format(string, sizeof(string), " Du wurdest in die Fraktion %s von Leader %s eingeladen.",Fracs[leader-1], sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
SendClientMessage(para1, COLOR_GRAD2, " Um die Einladung anzunehmen: /einladung annehmen");
//SendClientMessage(para1, COLOR_GRAD2, " Um die Einladung abzulehnen: /einladung ablehnen");
format(string, sizeof(string), " Du hast %s in die Fraktion %s eingeladen.", giveplayer,Fracs[leader-1]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
SendClientMessage(playerid, COLOR_GRAD2, " Der Spieler muss nun deine Einladung annehmen oder ablehnen.");
new iyear, imonth,iday;
getdate(iyear, imonth, iday);
format(string, sizeof(string), "%s[Level:%d] wurde von %s in die Fraktion %s eingeladen (%d-%d-%d)", giveplayer,PlayerInfo[para1][pLevel],sendername,Fracs[leader-1],imonth,iday,iyear);
MemberLog(string);
Eingeladen[para1] = leader;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Dieser Spieler hat eine Fraktions-Sperre oder ist noch nicht LvL 3");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Dieser Spieler ist in einer anderen Fraktion oder bereits ein Fraktionsmitglied.");
return 1;
}
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Nur der Leader kann diesen Befehl nutzen!");
}
return 1;
}
if(strcmp(cmd,"/einladung",true) == 0)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "BENUTZUNG: /einladung [annehmen/ablehnen]");
return 1;
}
if(Eingeladen[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "Du wurdest in keine Fraktion eingeladen!");
return 1;
}
if(strcmp(tmp,"annehmen",true) == 0)
{
if(Eingeladen[playerid] == 1) { PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ChosenSkin[playerid] = 280; SetPlayerSkin(playerid, 280); }
else if(Eingeladen[playerid] == 2) { PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ChosenSkin[playerid] = 280; SetPlayerSkin(playerid, 280); }
else if(Eingeladen[playerid] == 3) { PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ChosenSkin[playerid] = 287; SetPlayerSkin(playerid, 287); }
else if(Eingeladen[playerid] == 4) { PlayerInfo[playerid][pTeam] = 1; gTeam[playerid] = 1; ChosenSkin[playerid] = 70; SetPlayerSkin(playerid, 70); }
else if(Eingeladen[playerid] == 5) { PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ChosenSkin[playerid] = 258; SetPlayerSkin(playerid, 120); }
else if(Eingeladen[playerid] == 6) { PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ChosenSkin[playerid] = 294; SetPlayerSkin(playerid, 294); }
else if(Eingeladen[playerid] == 7) { PlayerInfo[playerid][pTeam] = 7; gTeam[playerid] = 7; ChosenSkin[playerid] = 164; SetPlayerSkin(playerid, 164); }
else if(Eingeladen[playerid] == 8) { PlayerInfo[playerid][pTeam] = 8; gTeam[playerid] = 8; ChosenSkin[playerid] = 250; SetPlayerSkin(playerid, 250); }
else if(Eingeladen[playerid] == 9) { PlayerInfo[playerid][pTeam] = 9; gTeam[playerid] = 9; ChosenSkin[playerid] = 187; SetPlayerSkin(playerid, 187); }
else if(Eingeladen[playerid] == 10) { PlayerInfo[playerid][pTeam] = 10; gTeam[playerid] = 10; ChosenSkin[playerid] = 255; SetPlayerSkin(playerid, 255); }
else if(Eingeladen[playerid] == 11) { PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; ChosenSkin[playerid] = 240; SetPlayerSkin(playerid, 240); }
else if(Eingeladen[playerid] == 12) { PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; ChosenSkin[playerid] = 118; SetPlayerSkin(playerid, 118); }//Hacker
else if(Eingeladen[playerid] == 13) { PlayerInfo[playerid][pTeam] = 13; gTeam[playerid] = 13; ChosenSkin[playerid] = 103; SetPlayerSkin(playerid, 103); }//Ballas
else if(Eingeladen[playerid] == 14) { PlayerInfo[playerid][pTeam] = 14; gTeam[playerid] = 14; ChosenSkin[playerid] = 19; SetPlayerSkin(playerid, 19); }//Groove Street
else if(Eingeladen[playerid] == 15) { PlayerInfo[playerid][pTeam] = 15; gTeam[playerid] = 15; ChosenSkin[playerid] = 185; SetPlayerSkin(playerid, 185); }//Los Santos Biker Club
else if(Eingeladen[playerid] == 16) { PlayerInfo[playerid][pTeam] = 16; gTeam[playerid] = 16; ChosenSkin[playerid] = 108; SetPlayerSkin(playerid, 108); }//MaraSalvatrucha
else if(Eingeladen[playerid] == 17) { PlayerInfo[playerid][pTeam] = 17; gTeam[playerid] = 17; ChosenSkin[playerid] = 114; SetPlayerSkin(playerid, 114); }//Varios Los
else if(Eingeladen[playerid] == 18) { PlayerInfo[playerid][pTeam] = 18; gTeam[playerid] = 18; ChosenSkin[playerid] = 173; SetPlayerSkin(playerid, 173); }//Vatos Locos
else if(Eingeladen[playerid] == 19) { PlayerInfo[playerid][pTeam] = 19; gTeam[playerid] = 19; ChosenSkin[playerid] = 234; SetPlayerSkin(playerid, 234); }//West Coust Customs
else if(Eingeladen[playerid] == 20) { PlayerInfo[playerid][pTeam] = 20; gTeam[playerid] = 20; ChosenSkin[playerid] = 220; SetPlayerSkin(playerid, 220); }
else if(Eingeladen[playerid] == 21) { PlayerInfo[playerid][pTeam] = 21; gTeam[playerid] = 21; ChosenSkin[playerid] = 28; SetPlayerSkin(playerid, 28); } else if(Eingeladen[playerid] == 22) { PlayerInfo[playerid][pTeam] = 22; gTeam[playerid] = 22; ChosenSkin[playerid] = 274; SetPlayerSkin(playerid, 274); }
else if(Eingeladen[playerid] == 23) { PlayerInfo[playerid][pTeam] = 23; gTeam[playerid] = 23; ChosenSkin[playerid] = 133; SetPlayerSkin(playerid, 133); }
else if(Eingeladen[playerid] == 24) { PlayerInfo[playerid][pTeam] = 24; gTeam[playerid] = 24; ChosenSkin[playerid] = 255; SetPlayerSkin(playerid, 255); }
else { return 1; }
GetPlayerName(playerid,sendername,sizeof(sendername));
PlayerInfo[playerid][pMember] = Eingeladen[playerid];
PlayerInfo[playerid][pRank] = 1;
format(string,sizeof(string)," %s hat die Einladung in die Fraktion %s angenommen!",sendername,Fracs[Eingeladen[playerid]-1]);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pLeader] == Eingeladen[playerid])
{
SendClientMessage(i,COLOR_LIGHTBLUE,string);
}
}
}
SetPlayerInterior(playerid,0);
new rand = random(sizeof(gInviteSpawns));
SetPlayerPos(playerid, gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]); // Warp the player
SetPlayerFacingAngle(playerid, gInviteSpawns[rand][3]);
SetPlayerCameraPos(playerid,gInviteSpawns[rand][0] + 3, gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
SetPlayerCameraLookAt(playerid,gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
FreezePlayer(playerid);
SelectChar[playerid] = 255;
Eingeladen[playerid] = 0;
SelectCharID[playerid] = PlayerInfo[playerid][pMember];
SelectCharPlace[playerid] = 1;
PlayerInfo[playerid][pModel] = ChosenSkin[playerid];
PlayerInfo[playerid][pChar] = ChosenSkin[playerid];
SendClientMessage(playerid, COLOR_GRAD5, " Du kannst mit /help deine neuen Fraktionsbefehle betrachten");
SendClientMessage(playerid, COLOR_LIGHTRED, "* Benutze 'weiter' um dir den Charakter auszusuchen den du gerne benutzen möchtest.");
SendClientMessage(playerid, COLOR_LIGHTRED, "* Wenn du den richtigen gefunden hast, gib 'fertig' ein.");
}
else if(strcmp(tmp,"ablehnen",true) == 0)
{
format(string,sizeof(string)," %s hat die Einladung in die Fraktion %s abgelehnt!",sendername,Fracs[Eingeladen[playerid]-1]);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pLeader] == Eingeladen[playerid])
{
SendClientMessage(i,COLOR_LIGHTBLUE,string);
}
}
}
Eingeladen[playerid] = 0;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutzung: /einladung [annehmen/ablehnen]");
}
return 1;
}
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "BENUTZUNG: /einladung [annehmen/ablehnen]");
return 1;
}
if(Eingeladen[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "Du wurdest in keine Fraktion eingeladen!");
return 1;
}
if(strcmp(tmp,"annehmen",true) == 0)
{
if(Eingeladen[playerid] == 1) { PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ChosenSkin[playerid] = 280; SetPlayerSkin(playerid, 280); }
else if(Eingeladen[playerid] == 2) { PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ChosenSkin[playerid] = 280; SetPlayerSkin(playerid, 280); }
else if(Eingeladen[playerid] == 3) { PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ChosenSkin[playerid] = 287; SetPlayerSkin(playerid, 287); }
else if(Eingeladen[playerid] == 4) { PlayerInfo[playerid][pTeam] = 1; gTeam[playerid] = 1; ChosenSkin[playerid] = 70; SetPlayerSkin(playerid, 70); }
else if(Eingeladen[playerid] == 5) { PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ChosenSkin[playerid] = 258; SetPlayerSkin(playerid, 120); }
else if(Eingeladen[playerid] == 6) { PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ChosenSkin[playerid] = 294; SetPlayerSkin(playerid, 294); }
else if(Eingeladen[playerid] == 7) { PlayerInfo[playerid][pTeam] = 7; gTeam[playerid] = 7; ChosenSkin[playerid] = 164; SetPlayerSkin(playerid, 164); }
else if(Eingeladen[playerid] == 8) { PlayerInfo[playerid][pTeam] = 8; gTeam[playerid] = 8; ChosenSkin[playerid] = 250; SetPlayerSkin(playerid, 250); }
else if(Eingeladen[playerid] == 9) { PlayerInfo[playerid][pTeam] = 9; gTeam[playerid] = 9; ChosenSkin[playerid] = 187; SetPlayerSkin(playerid, 187); }
else if(Eingeladen[playerid] == 10) { PlayerInfo[playerid][pTeam] = 10; gTeam[playerid] = 10; ChosenSkin[playerid] = 255; SetPlayerSkin(playerid, 255); }
else if(Eingeladen[playerid] == 11) { PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; ChosenSkin[playerid] = 240; SetPlayerSkin(playerid, 240); }
else if(Eingeladen[playerid] == 12) { PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; ChosenSkin[playerid] = 118; SetPlayerSkin(playerid, 118); }//Hacker
else if(Eingeladen[playerid] == 13) { PlayerInfo[playerid][pTeam] = 13; gTeam[playerid] = 13; ChosenSkin[playerid] = 103; SetPlayerSkin(playerid, 103); }//Ballas
else if(Eingeladen[playerid] == 14) { PlayerInfo[playerid][pTeam] = 14; gTeam[playerid] = 14; ChosenSkin[playerid] = 19; SetPlayerSkin(playerid, 19); }//Groove Street
else if(Eingeladen[playerid] == 15) { PlayerInfo[playerid][pTeam] = 15; gTeam[playerid] = 15; ChosenSkin[playerid] = 185; SetPlayerSkin(playerid, 185); }//Los Santos Biker Club
else if(Eingeladen[playerid] == 16) { PlayerInfo[playerid][pTeam] = 16; gTeam[playerid] = 16; ChosenSkin[playerid] = 108; SetPlayerSkin(playerid, 108); }//MaraSalvatrucha
else if(Eingeladen[playerid] == 17) { PlayerInfo[playerid][pTeam] = 17; gTeam[playerid] = 17; ChosenSkin[playerid] = 114; SetPlayerSkin(playerid, 114); }//Varios Los
else if(Eingeladen[playerid] == 18) { PlayerInfo[playerid][pTeam] = 18; gTeam[playerid] = 18; ChosenSkin[playerid] = 173; SetPlayerSkin(playerid, 173); }//Vatos Locos
else if(Eingeladen[playerid] == 19) { PlayerInfo[playerid][pTeam] = 19; gTeam[playerid] = 19; ChosenSkin[playerid] = 234; SetPlayerSkin(playerid, 234); }//West Coust Customs
else if(Eingeladen[playerid] == 20) { PlayerInfo[playerid][pTeam] = 20; gTeam[playerid] = 20; ChosenSkin[playerid] = 220; SetPlayerSkin(playerid, 220); }
else if(Eingeladen[playerid] == 21) { PlayerInfo[playerid][pTeam] = 21; gTeam[playerid] = 21; ChosenSkin[playerid] = 28; SetPlayerSkin(playerid, 28); } else if(Eingeladen[playerid] == 22) { PlayerInfo[playerid][pTeam] = 22; gTeam[playerid] = 22; ChosenSkin[playerid] = 274; SetPlayerSkin(playerid, 274); }
else if(Eingeladen[playerid] == 23) { PlayerInfo[playerid][pTeam] = 23; gTeam[playerid] = 23; ChosenSkin[playerid] = 133; SetPlayerSkin(playerid, 133); }
else if(Eingeladen[playerid] == 24) { PlayerInfo[playerid][pTeam] = 24; gTeam[playerid] = 24; ChosenSkin[playerid] = 255; SetPlayerSkin(playerid, 255); }
else { return 1; }
GetPlayerName(playerid,sendername,sizeof(sendername));
PlayerInfo[playerid][pMember] = Eingeladen[playerid];
PlayerInfo[playerid][pRank] = 1;
format(string,sizeof(string)," %s hat die Einladung in die Fraktion %s angenommen!",sendername,Fracs[Eingeladen[playerid]-1]);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pLeader] == Eingeladen[playerid])
{
SendClientMessage(i,COLOR_LIGHTBLUE,string);
}
}
}
SetPlayerInterior(playerid,0);
new rand = random(sizeof(gInviteSpawns));
SetPlayerPos(playerid, gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]); // Warp the player
SetPlayerFacingAngle(playerid, gInviteSpawns[rand][3]);
SetPlayerCameraPos(playerid,gInviteSpawns[rand][0] + 3, gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
SetPlayerCameraLookAt(playerid,gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
FreezePlayer(playerid);
SelectChar[playerid] = 255;
Eingeladen[playerid] = 0;
SelectCharID[playerid] = PlayerInfo[playerid][pMember];
SelectCharPlace[playerid] = 1;
PlayerInfo[playerid][pModel] = ChosenSkin[playerid];
PlayerInfo[playerid][pChar] = ChosenSkin[playerid];
SendClientMessage(playerid, COLOR_GRAD5, " Du kannst mit /help deine neuen Fraktionsbefehle betrachten");
SendClientMessage(playerid, COLOR_LIGHTRED, "* Benutze 'weiter' um dir den Charakter auszusuchen den du gerne benutzen möchtest.");
SendClientMessage(playerid, COLOR_LIGHTRED, "* Wenn du den richtigen gefunden hast, gib 'fertig' ein.");
}
else if(strcmp(tmp,"ablehnen",true) == 0)
{
format(string,sizeof(string)," %s hat die Einladung in die Fraktion %s abgelehnt!",sendername,Fracs[Eingeladen[playerid]-1]);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pLeader] == Eingeladen[playerid])
{
SendClientMessage(i,COLOR_LIGHTBLUE,string);
}
}
}
Eingeladen[playerid] = 0;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutzung: /einladung [annehmen/ablehnen]");
}
return 1;
}
Danke für die Hilfe.