Vehicle OwnerShip System - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Vehicle OwnerShip System (
/showthread.php?tid=374308)
Vehicle OwnerShip System -
CROSS_Hunter - 02.09.2012
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..