Please Hellp[CarOwnership]
#1

I edit one fs UlricVehicleSystem,and i put one command with which opening а dialog
in that dialog you have to park,sell,lock,tack and sell car to player.
but the last command (sell car to player) doesn't work,i don't know what it the problem
this is the command:
Quote:

if(dialogid == PRODAZBA)
{
if(response)
{
if(GetPlayerMoney(playerid) >= SellCarInfo[SellCost])
{
new string[256], tmp[256];
GiveCarTo(SellCarInfo[VehID],SellCarInfo[Owner], playerid, SellCarInfo[SellCost]);
format(string, sizeof(string), "Ja prifativte ponudata na %s", Gn(SellCarInfo[Owner]));
SendClientMessage(playerid, Green, string);
format(tmp, sizeof(tmp), "%s Ja prifati vasata ponuda", Gn(playerid));
SendClientMessage(SellCarInfo[Owner], Green, tmp);
}
else
{
SendClientMessage(playerid, Red, "GRESKA:{FFFFFF}Nemate dovolno pari !!!");
}
}
else
{
new string[128], vehicleid;
format(string, sizeof(string), "%s Ja odbi vasata ponuda ...", Gn(playerid));
SendClientMessage(VehicleInfo[vehicleid][Owner], Red, string);
}
return 1;
}
return 0;
}

This is the function of the command :
Quote:

GiveCarTo(vehicleid, playerid, playerid2, cost)
{
SetPlayerVehicle(playerid2, vehicleid);
SetPlayerNotHaveVehicle(playerid);
GivePlayerMoney(playerid, cost);
GivePlayerMoney(playerid2, -cost);
SetVehicleOwner2(vehicleid, playerid2);
}
// this is fo having vehicle
forward SetPlayerVehicle(playerid, vehicleid);
public SetPlayerVehicle(playerid, vehicleid)
{
dini_IntSet(PFile(playerid),"HaveCar",1);
dini_IntSet(VFile(vehicleid),"Owned",1);
dini_Set(VFile(vehicleid),"Owner",Gn(playerid));
dini_IntSet(PFile(playerid),"CarID",vehicleid);
}
the problem is that when you sell car to other player you sell the car but the car its not belongs of the player ..

Please hellp me
and sorry for my bad english.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)