23.04.2015, 14:42
When using
Make sure to check if the string is empty or else it will return 0.
So the code should be
Also make sure that hOwner have enough space to hold the name in your enum or whatever you're using.
For the dialog part |
Use the callback OnDialogResponse
I recommend using simple commands like /enter - /exit, why wasting dialogs for something ridiculous.
Код:
if (strcmp(HouseInfo[i][hOwner], fName, false))
So the code should be
Код:
if (strlen(fName) != 0 && strlen(HouseInfo[i][hOwner]) != 0) { if (strcmp(HouseInfo[i][hOwner], fName, false)) { // Code goes here
Код:
hOwner[MAX_PLAYER_NAME],
Use the callback OnDialogResponse
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_GOTO_HOUSE) { if(!response) return ShowDialog... //Show dialog again, you need to choose. if(response) { switch(listitem) { case 0: EnterHouse(HouseInfo[i][hID]); // 1st place holder for entering the house interior as a function case 1: ExitHouse(); // 2nd place holder for exiting } } } // return true; // Don't forget this return value }