07.07.2012, 15:36
I have this dialogmenu where i spawn cars.
As soon as i have removed a vehicle, and try to spawn a new one it just pops up and dissapears.
How come?
Spawn Code.
Removal Code.
As soon as i have removed a vehicle, and try to spawn a new one it just pops up and dissapears.
How come?
Spawn Code.
Код:
CarSpawner2(playerid,480);
Код:
CarDeleter2(PlayerInfo[playerid][pCar2]);
Код:
forward CarSpawner2(playerid,model); public CarSpawner2(playerid,model) { if(PlayerInfo[playerid][pCar2] != -1) CarDeleter2(PlayerInfo[playerid][pCar2]); new vehicleid2=CreateVehicle(model, VehicleX, VehicleY, VehicleZ, VehicleAngle, -1, -1, -1); ChangeVehicleColor(vehicleid2,0,0); PlayerInfo[playerid][pCar2] = vehicleid2; } forward CarDeleter2(vehicleid); public CarDeleter2(vehicleid) { for(new i=0;i<MAX_PLAYERS;i++) { SetVehicleParamsForPlayer(vehicleid,i,0,1); } SetTimerEx("VehRes2",500,0,"i",vehicleid); } forward VehRes2(vehicleid); public VehRes2(vehicleid) { DestroyVehicle(vehicleid); } public OnVehicleSpawn(vehicleid) { for(new i=0;i<MAX_PLAYERS;i++) { if(vehicleid==PlayerInfo[i][pCar2]) { CarDeleter2(vehicleid); PlayerInfo[i][pCar2]=-1; } } return 1; }