08.07.2012, 13:19
Why does the condition is executed only "playerid", and for the "Duel [playerid]" not? Help please.
Cause the player to a duel:
Accept / Reject a duel:
Cause the player to a duel:
Код:
if(listitem == 1) { new pName[MAX_PLAYER_NAME]; GetPlayerName(clickp[playerid], pName, sizeof(pName)); format(string,sizeof string,"Игрок %s(%i) вызывает Вас на дуэль\nВы согласны?",pName,playerid); ShowPlayerDialog(Duel[playerid],AccDuel,DIALOG_STYLE_MSGBOX,"Вызов на дуэль:",string,"Принять","Отклонить"); } } }
Код:
if(dialogid == AccDuel) { if(response) { if(!strlen(inputtext)) Duel[playerid] = strval(inputtext); Duel[Duel[playerid]] = playerid; ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid,31,9999); GivePlayerWeapon(playerid,24,9999); GivePlayerWeapon(playerid,25,9999); SetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 100); SetPlayerPos(playerid,2105.8318,2428.2993,45.2188); // ResetPlayerWeapons(Duel[playerid]); GivePlayerWeapon(Duel[playerid],31,9999); GivePlayerWeapon(Duel[playerid],24,9999); GivePlayerWeapon(Duel[playerid],25,9999); SetPlayerHealth(Duel[playerid], 100); SetPlayerArmour(Duel[playerid], 100); SetPlayerPos(Duel[playerid],2060.2151,2385.5791,45.2265); } else { Duel[Duel[playerid]] = INVALID_PLAYER_ID; Duel[playerid] = INVALID_PLAYER_ID; SendClientMessage(playerid,-1,"Игрок решил не принимать участие в дуэли."); SendClientMessage(Duel[playerid],-1,"Вы решили не принимать участие в дуэли."); } return 1; }