i have problem with names
#9

When using
Код:
if (strcmp(HouseInfo[i][hOwner], fName, false))
Make sure to check if the string is empty or else it will return 0.
So the code should be
Код:
if (strlen(fName) != 0 && strlen(HouseInfo[i][hOwner]) != 0) {
    if (strcmp(HouseInfo[i][hOwner], fName, false)) {
        // Code goes here
Also make sure that hOwner have enough space to hold the name in your enum or whatever you're using.
Код:
hOwner[MAX_PLAYER_NAME],
For the dialog part |
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
}
I recommend using simple commands like /enter - /exit, why wasting dialogs for something ridiculous.
Reply


Messages In This Thread
i have problem with names - by giorgosdim12 - 22.04.2015, 18:17
Re: i have problem with names - by donsta3000 - 22.04.2015, 20:36
Re: i have problem with names - by Azula - 22.04.2015, 20:52
Re: i have problem with names - by giorgosdim12 - 23.04.2015, 13:31
Re: i have problem with names - by Konstantinos - 23.04.2015, 13:40
Re: i have problem with names - by Maximun - 23.04.2015, 13:48
Re: i have problem with names - by giorgosdim12 - 23.04.2015, 14:14
Re: i have problem with names - by giorgosdim12 - 23.04.2015, 14:18
Re: i have problem with names - by AberKane - 23.04.2015, 14:42
Re: i have problem with names - by giorgosdim12 - 23.04.2015, 15:04

Forum Jump:


Users browsing this thread: 2 Guest(s)