SA-MP Forums Archive
Buy vehicle help - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Buy vehicle help (/showthread.php?tid=166167)



Buy vehicle help - vection - 07.08.2010

i made a car system, but i have a problem. after i bought a vehicle its work, its spawned but if some one after me will buy the vehicle set in his file but not spawned at the spot.
basicly the problem is spawn after buy.
sometimes the vehicle spawned and sometimes not.

code:
public vehicletimer(playerid)
{
new vehicleid;
new color1 = CarColor[playerid][0];
new color2 = CarColor[playerid][1];
if(carbiz[playerid] == 1)
{
if(PlayerInfo[playerid][pKeyCar] == 0)
{
ShopCar[playerid] = AddStaticVehicle(carmodel[playerid], 342.4700,-1340.2903,14.2172,117.3717, color1, color2, -1);
SetVehicleVirtualWorld(ShopCar[playerid], 0);
strmid(VehicleInfo[ShopCar[playerid]][vOwner], GetName(playerid), 0, strlen(GetName(playerid)), MAX_PLAYER_NAME);

vehicleid = ShopCar[playerid];
PlayerInfo[playerid][pvehiclem5] = GetVehicleModel(vehicleid);
PlayerInfo[playerid][pvehiclex5] = 342.4700;
PlayerInfo[playerid][pvehicley5] = -1340.2903;
PlayerInfo[playerid][pvehiclez5] = 14.2172;
PlayerInfo[playerid][pvehiclea5] = 117.3717;
for(new m = 0; m < MAX_MODS; m++) VehicleInfo[vehicleid][vMod][m] = 0;
SendClientMessage(playerid, COLOR_GREEN, "Your car has now placed.");
PlayerInfo[playerid][pKeyCar] += 1;
vehiclenumber1[playerid] = ShopCar[playerid];
DateProp(playerid);
OnPropUpdate();
OnPlayerUpdate(playerid);
youbuy[playerid] = 0;
VehicleInfo[vehicleid][vModel] = 1;
return 1;
}
}
}


Re: Buy vehicle help - ScottCFR - 07.08.2010

Next time, try [code] tags...


Re: Buy vehicle help - vection - 07.08.2010

i dont see any code tag here..


Re: Buy vehicle help - Kar - 07.08.2010

do this

[,pawn] code here [,/pawn]

remove the ,'s