Posts: 617
Threads: 129
Joined: Feb 2014
i mad a car spawner command and its 100% working,but i have 1 small problem why when i spawn a car and the car got damage(caught fire and blow up)it respawns at the place/position you spawned it.Im wondering if there is a way to stop that from happening
Posts: 617
Threads: 129
Joined: Feb 2014
pawn Код:
COMMAND:car(playerid,params[])
{
if(AdminLevel[playerid] >= 3)
{
new car;
if(IsPlayerInAnyVehicle(playerid)) return 1;
if(sscanf(params, "i", car)) return SendClientMessage(playerid, COLOR_RED, "USE: /car [car id]");
if(strval(params) >611 || strval(params) <400) return SendClientMessage(playerid, COLOR_RED, "That id doesn't exist[400-611]");
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x,y,z);
GetPlayerFacingAngle(playerid, a);
car = CreateVehicle(strval(params), x, y, z,a, -1, -1, 60);
PutPlayerInVehicle(playerid, car, 0);
}
else SendClientMessage(playerid,COLOR_RED,"You need to be an level 3 admin to use this command");
return 1;
}
Posts: 303
Threads: 27
Joined: Aug 2013
Reputation:
0
car = CreateVehicle(strval(params), x, y, z,a, -1, -1, -1);
This will prevent the car from respawning. Just replaced the 60 seconds time delay to -1.
Hope it solves your problem.
Posts: 617
Threads: 129
Joined: Feb 2014
Quote:
Originally Posted by DavidBilla
car = CreateVehicle(strval(params), x, y, z,a, -1, -1, -1);
This will prevent the car from respawning. Just replaced the 60 seconds time delay to -1.
Hope it solves your problem.
|
doesnt work any other suggestion
Posts: 617
Threads: 129
Joined: Feb 2014
Quote:
Originally Posted by ThePhenix
You can test this, it surely will work:
PHP код:
new CarToDestroy[MAX_VEHICLES];
COMMAND:car(playerid,params[])
{
if(AdminLevel[playerid] >= 3)
{
new car;
if(IsPlayerInAnyVehicle(playerid)) return 1;
if(sscanf(params, "i", car)) return SendClientMessage(playerid, COLOR_RED, "USE: /car [car id]");
if(strval(params) >611 || strval(params) <400) return SendClientMessage(playerid, COLOR_RED, "That id doesn't exist[400-611]");
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x,y,z);
GetPlayerFacingAngle(playerid, a);
CarToDestroy[car] = CreateVehicle(strval(params), x, y, z,a, -1, -1, 60);
PutPlayerInVehicle(playerid, CarToDestroy[car], 0);
}
else SendClientMessage(playerid,COLOR_RED,"You need to be an level 3 admin to use this command");
return 1;
}
public OnVehicleSpawn(vehicleid)
{
for(new i; i < MAX_VEHICLES; i++)
{
if(vehicleid == CarToDestroy[i])
{
DestroyVehicle(vehicleid);
break;
}
}
return 1;
}
|
Thanks man