28.01.2013, 19:03
When i choose an item from the DIALOG_WEAPONS it writes text into the player.txt from DIALOG_REGISTER. Please help.
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_REGISTER) { if(response) { new File:players=fopen("players.txt", io_append); fwrite(players,inputtext); fclose(players); } if(response==1) { SendClientMessage(playerid,0xFF0000FF," nu"); } } if(dialogid == DIALOG_WEAPONS) { if(response) { if(listitem == 0) { if(money > 999) { GivePlayerMoney(playerid, -1000); GivePlayerWeapon(playerid,46, 1); //Parachute SendClientMessage(playerid, 0xFF0000FF, "You bought a parachute."); } else { SendClientMessage(playerid, 0xFF0000FF, "Insufficient funds."); } } if(listitem == 1) { if(money > 499) { GivePlayerMoney(playerid, -500); GivePlayerWeapon(playerid, 22, 120); //9mm SendClientMessage(playerid, 0xFF0000FF, "You bought a 9mm pistol."); } else { SendClientMessage(playerid, 0xFF0000FF, "Insufficient funds."); } } } } }