Vehicle ownership
#1

Hi, i made this really quick just to see if it works:

pawn Code:
CMD:buycar(playerid, params[])
{
    new vehicle;
    new Float:X, Float:Y, Float:Z, Float:A;
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, A);
    if(sscanf(params,"i",vehicle)) return SendClientMessage(playerid, -1, "use /buycar");
    VehInfo[vehicle][Owner] = PlayerName(playerid);
    VehInfo[vehicle][modelid] = vehicle;
    VehInfo[vehicle][carid] = CreateVehicle(vehicle, X, Y, Z, A, 0, 1, -1);
    return 1;
}
pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
        new name[24];
        GetPlayerName(playerid, name, 24);
        if(!strcmp(name,VehInfo[vehicleid][Owner]))
        {
            SendClientMessage(playerid, -1, "not ur car");
        }
        else
        {
            SendClientMessage(playerid, -1, "welcome to your car");
        }

    return 1;
}
It always says not you car even after ive used buy car
Reply


Messages In This Thread
Vehicle ownership - by thefatshizms - 26.10.2012, 14:52
Re: Vehicle ownership - by zDivine - 26.10.2012, 15:08
Re: Vehicle ownership - by thefatshizms - 26.10.2012, 17:46
Re: Vehicle ownership - by thefatshizms - 27.10.2012, 19:06

Forum Jump:


Users browsing this thread: 1 Guest(s)