dini problems
#5

Thanks, its a lot better than the code I was just using. Now I seem to be having a problem with the Owner variable.

I want it to say this when you enter a vehicle.
If the vehicle is owned by you it should say "INFO: Welcome to your vehicle 'Name'."
And if the vehicle isn't owned by you it should say "INFO: This vehicle is owned by 'Name'."

But unfortunately it does say that but its all wrong, here's my fail code:

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new file[128], str[128], name[MAX_PLAYER_NAME];
        new vehicleid = GetPlayerVehicleID(playerid);
        GetPlayerName(playerid, name, sizeof(name));
        format(file, sizeof(file), "/Vehicles/%d.ini", vehicleid);
        format(name, sizeof(name), "%s", dini_Get(file, "Owner"));
        foreach(Player, i)
        {
            if(PlayerInfo[i][pCarKey] == vehicleid)
            {
                format(str, sizeof(str), "INFO: This vehicle is owned by %s.", name);
            }
            else if(PlayerInfo[i][pCarKey] != vehicleid)
            {
                format(str, sizeof(str), "INFO: Welcome to your vehicle %s.", name);
            }
            SendClientMessage(playerid, COLOR_YELLOW, str);
        }
    }
    return 1;
}
And heres my variable for vOwner.

pawn Код:
vOwner[MAX_PLAYER_NAME]
Reply


Messages In This Thread
dini problems [Fixed]. - by Luis- - 31.08.2011, 20:24
Re: dini problems - by Kush - 31.08.2011, 20:34
Re: dini problems - by Luis- - 31.08.2011, 20:46
Re: dini problems - by Luis- - 31.08.2011, 21:28
Re: dini problems - by Luis- - 31.08.2011, 22:42
Re: dini problems - by AustinJ - 31.08.2011, 22:48
Re: dini problems - by Luis- - 31.08.2011, 22:49
Re: dini problems - by IceCube! - 31.08.2011, 22:54
Re: dini problems - by Luis- - 31.08.2011, 23:31
Re: dini problems - by Luis- - 01.09.2011, 01:11

Forum Jump:


Users browsing this thread: 3 Guest(s)