02.09.2015, 12:37
Look how i made and dosen't work
PHP код:
if(dialogid == DIALOG_F_PANEL2)
{
if(response)
{
new id,Fstring[100],giveplayer[30],Fsendername[30];
if(sscanf(inputtext, "u", id)) return SCM(playerid,-1,"");
new ftext[120];
if(PlayerInfo[id][pFpunish] != 0) return SCM(playerid,COLOR_WHITE,"{FFB870}You can not invite this player because it has faction punish");
if(id != INVALID_PLAYER_ID) return SCM(playerid,-1,"Acest jucator nu este conectat.");
if(PlayerInfo[id][pMember] == 0 && PlayerInfo[id][pLeader] == 0)
{
if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1)
{
PlayerInfo[id][pTeam] = 2;
gTeam[id] = 2;
ftext = "LSPD";
ChosenSkin[id] = 266;
SetPlayerSkin(id, 266);
}
else if(PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 2)
{
PlayerInfo[id][pTeam] = 2;
gTeam[id] = 2;
ftext = "Dillimore Police Departament";
ChosenSkin[id] = 288;
SetPlayerSkin(id, 288);
}
else if(PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 3)
{
PlayerInfo[id][pTeam] = 2;
gTeam[id] = 2;
ftext = "Las Venturas Police Departament";
ChosenSkin[id] = 71;
SetPlayerSkin(id, 71);
}
else if(PlayerInfo[playerid][pLeader] == 4 || PlayerInfo[playerid][pMember] == 4)
{
PlayerInfo[id][pTeam] = 5;
gTeam[id] = 5;
ftext = "Ballas";
ChosenSkin[id] = 104;
SetPlayerSkin(id, 104);
}
else if(PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 5)
{
PlayerInfo[id][pTeam] = 5;
gTeam[id] = 5;
ftext = "Los Aztecas";
ChosenSkin[id] = 114;
SetPlayerSkin(id, 114);
}
else if(PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[playerid][pMember] == 6)
{
PlayerInfo[id][pTeam] = 5;
gTeam[id] = 5;
ftext = "Los Santos Vagos";
ChosenSkin[id] = 108;
SetPlayerSkin(id, 108);
}
else if(PlayerInfo[playerid][pLeader] == 7 || PlayerInfo[playerid][pMember] == 7)
{
PlayerInfo[id][pTeam] = 2;
gTeam[id] = 2;
ftext = "Factiunea Staffului";
ChosenSkin[id] = 228;
SetPlayerSkin(id, 228);
}
else if(PlayerInfo[playerid][pLeader] == 8 || PlayerInfo[playerid][pMember] == 8)
{
PlayerInfo[id][pTeam] = 4;
gTeam[id] = 4;
ftext = "Tow Car Co.";
ChosenSkin[id] = 42;
SetPlayerSkin(id, 42);
}
else if(PlayerInfo[playerid][pLeader] == 9 || PlayerInfo[playerid][pMember] == 9)
{
PlayerInfo[id][pTeam] = 4;
gTeam[id] = 4;
ftext = "News Reporter";
ChosenSkin[id] = 72;
SetPlayerSkin(id, 72);
}
else if(PlayerInfo[playerid][pLeader] == 10 || PlayerInfo[playerid][pMember] == 10)
{
PlayerInfo[id][pTeam] = 5;
gTeam[id] = 5;
ftext = "Grove Street";
ChosenSkin[id] = 107;
SetPlayerSkin(id, 107);
}
else if(PlayerInfo[playerid][pLeader] == 11 || PlayerInfo[playerid][pMember] == 11)
{
PlayerInfo[id][pTeam] = 11;
gTeam[id] = 11;
ftext = "Hitman Agency";
ChosenSkin[id] = 120;
SetPlayerSkin(id, 120);
}
else if(PlayerInfo[playerid][pLeader] == 12 || PlayerInfo[playerid][pMember] == 12)
{
PlayerInfo[id][pTeam] = 4;
gTeam[id] = 4;
ftext = "School Instructor";
ChosenSkin[id] = 101;
SetPlayerSkin(id, 101);
}
else if(PlayerInfo[playerid][pLeader] == 13 || PlayerInfo[playerid][pMember] == 13)
{
PlayerInfo[id][pTeam] = 4;
gTeam[id] = 4;
ftext = "Taxi Company";
ChosenSkin[id] = 261;
SetPlayerSkin(id, 261);
}
else if(PlayerInfo[playerid][pLeader] == 14 || PlayerInfo[playerid][pMember] == 14)
{
PlayerInfo[id][pTeam] = 4;
gTeam[id] = 4;
ftext = "Paramedic Dep.";
ChosenSkin[id] = 276;
SetPlayerSkin(id, 276);
}
else { return 1; }
GetPlayerName(id, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, Fsendername, sizeof(Fsendername));
PlayerInfo[id][pMember] = PlayerInfo[playerid][pMember];
PlayerInfo[id][pRank] = 1;
printf("AdmCmd: %s has invited %s to join %s.", Fsendername, giveplayer, ftext);
format(Fstring, sizeof(Fstring), "Ai fost invitat de catre liderul %s in factiunea %s!", Fsendername,ftext);
SCM(id, COLOR_LIGHTBLUE, Fstring);
format(Fstring, sizeof(Fstring), "L-ai invitat pe %s in factiunea ta.", giveplayer);
SCM(playerid, COLOR_LIGHTBLUE, Fstring);
SetPlayerHealthEx(id, 0);
new wakaname[25],str[128];
GetPlayerName(id,wakaname,sizeof(wakaname));
format(str,sizeof(str),"UPDATE users SET `Team`='%d',`Member`='%d',`Rank`='1' WHERE `name`='%s'",PlayerInfo[id][pTeam],PlayerInfo[id][pMember],wakaname);
mysql_query(SQL,str);
Factionlog(PlayerInfo[id][pMember],PlayerInfo[id][pSQLID],"Joined the Faction.");
}
else
{
SCM(playerid, 0xFFB870FF, "Acest player are wanted sau este intr-o factiune.");
return 1;
}
}
else return ShowPlayerDialog(playerid, DIALOG_F_PANEL, DIALOG_STYLE_LIST, "Panel liderii:", "Invita un jucator\nScoate un jucator afara\nSeteaza rank-ul unui jucator\nSeteaza jobul\nAdvertisment jucator\nScoate advertisment\n", "Select", "Cancel");
}