22.02.2012, 08:51
i have this /invite
how can i make the On dialog resposne that when i send the invitation he will need to accept it ? before he can join how can i make that i tryed really i get a lot of errors!
Код:
if(strcmp(cmd, "/invite", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /invite [playerid/PartOfName]"); return 1; } new para1; new ftext[20]; para1 = ReturnUser(tmp); if (PlayerInfo[playerid][pLeader] >= 1) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { if(PlayerInfo[playerid][pLeader] == 1) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "Police Department"; ChosenSkin[para1] = 282; SetPlayerSkin(para1, 282); } else if(PlayerInfo[playerid][pLeader] == 2) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "FBI"; ChosenSkin[para1] = 24; SetPlayerSkin(para1, 24); } else if(PlayerInfo[playerid][pLeader] == 3) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "ARM"; ChosenSkin[para1] = 285; SetPlayerSkin(para1, 285); } else if(PlayerInfo[playerid][pLeader] == 4) { PlayerInfo[para1][pTeam] = 1; gTeam[para1] = 1; ftext = "Ambulance"; ChosenSkin[para1] = 276; SetPlayerSkin(para1, 276); } else if(PlayerInfo[playerid][pLeader] == 5) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "La Cosa Nostra"; ChosenSkin[para1] = 125; SetPlayerSkin(para1, 125); } else if(PlayerInfo[playerid][pLeader] == 6) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Yakuza"; ChosenSkin[para1] = 121; SetPlayerSkin(para1, 121); } else if(PlayerInfo[playerid][pLeader] == 7) { return 1; } else if(PlayerInfo[playerid][pLeader] == 8) { PlayerInfo[para1][pTeam] = 10; gTeam[para1] = 12; ftext = "Hitman Agency"; ChosenSkin[para1] = 258; SetPlayerSkin(para1, 258); } else if(PlayerInfo[playerid][pLeader] == 9) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Kanal 5 Studio"; ChosenSkin[para1] = 1; SetPlayerSkin(para1, 1); } else if(PlayerInfo[playerid][pLeader] == 10) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Taxi Companijata"; ChosenSkin[para1] = 210; SetPlayerSkin(para1, 210); } else if(PlayerInfo[playerid][pLeader] == 12) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Los Santos Gang"; ChosenSkin[para1] = 175; SetPlayerSkin(para1, 175); } else if(PlayerInfo[playerid][pLeader] == 13) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Groove Street Gang"; ChosenSkin[para1] = 105; SetPlayerSkin(para1, 105); } else if(PlayerInfo[playerid][pLeader] == 11) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "School Instructors"; ChosenSkin[para1] = 59; SetPlayerSkin(para1, 59); } else { return 1; } new str[128]; new playername[MAX_PLAYER_NAME]; GetPlayerName(playerid,playername,sizeof(playername)); format(str,sizeof(str),"Liderot %s ve pokani da se pridruzite vo negovata ORG",playername); ShowPlayerDialog(para1,1,DIALOG_STYLE_MSGBOX,"Invitation",str,"Accept","Decline"); PlayerInfo[para1][pMember] = PlayerInfo[playerid][pLeader]; PlayerInfo[para1][pRank] = 1; SendClientMessage(para1, COLOR_LIGHTBLUE, string); SetPlayerInterior(para1,0); } }//not connected } else { SendClientMessage(playerid, COLOR_GRAD1, " Ne ste ovlasteni za taa komanda,samo lideri!"); } } return 1; }