Vehicle OwnerShip System
#1

i use this dsystem vdealer every thing is working fine but when i use /park it says this vehicle isnt owned by you while i am the one who bought it


this is the park command in the .inc file

pawn Код:
COMMAND:park(playerid,params[])
{
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,color_red1,"You are not in a vehicle!");
    new veh = GetPlayerVehicleID(playerid),Float:x,Float:y,Float:z,Float:rot;
    if(!IsVehiclePrivate(veh)) return SendClientMessage(playerid,color_red1,"You are not in a private vehicle!");
    new pName[MAX_PLAYER_NAME];GetPlayerName(playerid,pName,sizeof pName);if(strcmp(pName,PrivateVehicles[ConvertVID(veh)][_owner])) return SendClientMessage(playerid,color_red1,"You are not the owner of this vehicle!");
    GetVehiclePos(veh,x,y,z);GetVehicleZAngle(veh,rot);

//  if(strcmp(pName,PrivateVehicles[ConvertVID(veh)][_owner])) return SendClientMessage(playerid,color_red1,"You are not the owner of this vehicle!");

    veh = ConvertVID(veh);
    PrivateVehicles[veh][_x] = x;
    PrivateVehicles[veh][_y] = y;
    PrivateVehicles[veh][_z] = z;
    PrivateVehicles[veh][_rot] = rot;

    SaveVehicle(PrivateVehicles[veh][_vehicleid]);
    SendClientMessage(playerid,color_yellow1,"You've succesfully parked your vehicle.");
    return 1;
}
and the /sellvehicle works fine.. and its almost the same code

pawn Код:
COMMAND:sellvehicle(playerid,params)
{
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,color_red1,"You are not in a vehicle!");
    new veh = GetPlayerVehicleID(playerid);
    if(!IsVehiclePrivate(veh)) return SendClientMessage(playerid,color_red1,"You are not in a private vehicle!");
    new pName[MAX_PLAYER_NAME];GetPlayerName(playerid,pName,sizeof pName);if(strcmp(pName,PrivateVehicles[ConvertVID(veh)][_owner])) return SendClientMessage(playerid,color_red1,"You are not the owner of this vehicle!");

    new str[93];format(str,sizeof str,"{FFFF00}Are you sure you want to sell your vehicle ? You will receive {FFFFFF}$%i",(PrivateVehicles[ConvertVID(veh)][_price] / SELL_DIVIDE));
    ShowPlayerDialog(playerid,DIALOG_SELL,0,"Selling your vehicle",str,"Yes","no");
    return 1;
}
and all the script fils are good i checked it plugins and every thing is fine..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)