Need help with car spawner
#6

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(playeridCOLOR_RED"USE: /car [car id]");
        if(
strval(params) >611 || strval(params) <400) return SendClientMessage(playeridCOLOR_RED"That id doesn't exist[400-611]");
        new 
Float:xFloat:yFloat:zFloat:a;
        
GetPlayerPos(playeridx,y,z);
        
GetPlayerFacingAngle(playerida);
        
CarToDestroy[car] = CreateVehicle(strval(params), xyz,a, -1, -160);
        
PutPlayerInVehicle(playeridCarToDestroy[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 
iMAX_VEHICLESi++)
    {
        if(
vehicleid == CarToDestroy[i])
        {
            
DestroyVehicle(vehicleid);
            break;
        }
    }
    return 
1;

Reply


Messages In This Thread
Need help with car spawner - by 1fret - 06.08.2014, 00:54
Re: Need help with car spawner - by Don_Cage - 06.08.2014, 01:14
Re: Need help with car spawner - by 1fret - 06.08.2014, 01:43
Re: Need help with car spawner - by DavidBilla - 06.08.2014, 02:01
Re: Need help with car spawner - by 1fret - 06.08.2014, 02:15
Respuesta: Need help with car spawner - by ThePhenix - 06.08.2014, 03:14
Re: Respuesta: Need help with car spawner - by 1fret - 06.08.2014, 03:27
Re: Need help with car spawner - by Threshold - 06.08.2014, 04:23
Respuesta: Re: Need help with car spawner - by ThePhenix - 06.08.2014, 04:57
Re: Need help with car spawner - by Threshold - 06.08.2014, 05:53

Forum Jump:


Users browsing this thread: 1 Guest(s)