Help with vehicle system.
#1

Lets get to the problem shall we?

pawn Код:
new ID = 0;
                    while(ID < sizeof(vehicles) && vehicles[ID])
                    {
                        ID++;
                    }
                    VehicleInfo[ID][owner] = PlayerName(playerid);
                    printf("owner: %s", VehicleInfo[ID][owner]);
                    VehicleInfo[ID][model] = 411;
                    VehicleInfo[ID][value] = 500;
                    VehicleInfo[ID][pannel_damage] = 0;
                    VehicleInfo[ID][door_damage] = 0;
                    VehicleInfo[ID][light_damage] = 0;
                    VehicleInfo[ID][tire_damage] = 0;
                    VehicleInfo[ID][owned] = true;
                    vehicle_creating =ID;
I print out this vehicles owner and it says my name (as i just bought it)


pawn Код:
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        new Vehicleid = GetPlayerVehicleID(playerid);
        printf("vehicle owned by: %s", VehicleInfo[Vehicleid][owner]);
        if(!strcmp(VehicleInfo[Vehicleid][owner], PlayerName(playerid), true))
        {
            SendClientMessage(playerid, -1, "This is not your vehicle");
            RemovePlayerFromVehicle(playerid);
        }
    }
I'm now checking if its my car, for some reason it would always kick me, so i added the print line and printed the vehicles owner variable and it returned nothing (null)

So what am i doing wrong?
Reply


Messages In This Thread
Help with vehicle system. - by thefatshizms - 08.01.2013, 17:16
Re: Help with vehicle system. - by Alternative112 - 08.01.2013, 22:19
Re: Help with vehicle system. - by thefatshizms - 09.01.2013, 16:46
Re: Help with vehicle system. - by thefatshizms - 11.01.2013, 17:09
Re: Help with vehicle system. - by LarzI - 11.01.2013, 18:34
Re: Help with vehicle system. - by thefatshizms - 11.01.2013, 22:06
Re: Help with vehicle system. - by park4bmx - 11.01.2013, 22:08
Re: Help with vehicle system. - by LarzI - 11.01.2013, 22:17
Re: Help with vehicle system. - by thefatshizms - 11.01.2013, 22:38
Re: Help with vehicle system. - by Threshold - 12.01.2013, 00:15

Forum Jump:


Users browsing this thread: 2 Guest(s)