Buy vehicle help
#1

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;
}
}
}
Reply
#2

Next time, try [code] tags...
Reply
#3

i dont see any code tag here..
Reply
#4

do this

[,pawn] code here [,/pawn]

remove the ,'s
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)