06.09.2012, 13:37
Hi,
Does anybody know how to define the username of the player who owns the car that I'm in? I've looked at SA-MP Wiki so don't say try looking there.
Getplayervehicleid[playerid]; Just defines the player-id, not the username, therefore it's only editing the actual car Owned to The State, and Owned = 0.
But the actual username would still own car id 3/4/5/6 etc, causing cars to mess up. I need a way for it to edit there car/car2 values to 9999.
Located in LARP/Users/%s.ini (%s been the username).
I currently have a Dini_Iniset but for some reason when I admin-sell it, It doesn't set the users car value to 9999.
None working code, need a possible fix, if possible, please.
Does anybody know how to define the username of the player who owns the car that I'm in? I've looked at SA-MP Wiki so don't say try looking there.
Getplayervehicleid[playerid]; Just defines the player-id, not the username, therefore it's only editing the actual car Owned to The State, and Owned = 0.
But the actual username would still own car id 3/4/5/6 etc, causing cars to mess up. I need a way for it to edit there car/car2 values to 9999.
Located in LARP/Users/%s.ini (%s been the username).
I currently have a Dini_Iniset but for some reason when I admin-sell it, It doesn't set the users car value to 9999.
None working code, need a possible fix, if possible, please.
Код:
// Fixed Car System
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pPcarkey] == vehid || PlayerInfo[i][pPcarkey2] == vehid)
{
if(PlayerInfo[i][pPcarkey] == vehid) PlayerInfo[i][pPcarkey] = 9999;
else if(PlayerInfo[i][pPcarkey2] == vehid) PlayerInfo[i][pPcarkey2] = 9999;
SafeGivePlayerMoney(i, GetVehiclePrice(vehid) / 2);
}
else
{
format(string, sizeof(string),"LARP/Users/%s.ini",CarInfo[vehid][cOwner]);
new totalcash = dini_Int(string,"Money") + GetVehiclePrice(vehid);
dini_IntSet(string,"Money",totalcash);
if(dini_Int(string,"Car") == vehid)
{
dini_IntSet(string,"Car",9999);
strmid(PlayerInfo[i][pPcarkey], "9999", 0, strlen("9999"), 9999);
}
else if(dini_Int(string,"Car2") == vehid)
{
dini_IntSet(string,"Car2",9999);
strmid(PlayerInfo[i][pPcarkey], "9999", 0, strlen("9999"), 9999);
}
}
}
}
// End Of Fix for the Car-Sell system //


