Destroy Current Vehicles Help
#8

I Use DestroyVehicle Function But Not Work Good! If Player In Vehicles And Take A New Vehicle My Cmd Destroy His Vehicle And Spawn a New Vehicle So Worked! But If Player Exit The Vehicle And Spawn A New Vehicle Dont Destroy Current Vehicles I Need Destroy His Current Vehicles At The All Time Take a new Vehicle!
This Is My Script
PHP код:
                                new currentveh;
                        
currentveh GetPlayerVehicleID(playerid);
                        
DestroyVehicle(currentveh); 
And This Is My Ful Car Spawn CMd For Admins
PHP код:
COMMAND:vc(playeridparams[])
{
    if(
spawnn[playerid] == 0) return 1;
    if(!
adminLevel(playerid1))
        return 
0;
        
    new 
tempCar[10], vsIDmessage[128];
    if(
sscanf(params"s[10]"tempCar))
    {
        
Usage(playerid"vc(reate) <vehicle name>");
    }
    else
    {
        
        new 
Float:xFloat:yFloat:zFloat:a;
        
vsID    getVehicleModelFromName(tempCar);
        if(
vsID 400 || vsID 612)
        {
            
Server(playerid"Unknown vehicle name.");
        }
        else
        {
            
GetPlayerFacingAngle(playerida);
            
GetPlayerPos(playeridxyz);
            if(
vsID == 612)
            {
                
SetPlayerSpecialAction(playeridSPECIAL_ACTION_USEJETPACK);
            }
            else
            {
                for(new 
0MAX_ADMIN_VEHICLESi++)
                {
                    if(!
GM[adminV][i])
                    {
                        new 
currentveh;    //<<<<<Not Work Good!
                        
currentveh GetPlayerVehicleID(playerid); //<<<<<Not Work Good!
                        
DestroyVehicle(currentveh);   //<<<<<Not Work Good!
                        
GM[adminV][i] = CreateVehicle(vsIDxyzarandom(255), random(255), 600000);
                        
LinkVehicleToInterior(GM[adminV][i], GetPlayerInterior(playerid));
                        
SetVehicleVirtualWorld(GM[adminV][i], GetPlayerVirtualWorld(playerid));
                        
PutPlayerInVehicle(playeridGM[adminV][i], 0);
                        
format(messagesizeof(message), "You have spawned a "CHAT_YELLOW"%s"CHAT_WHITE"."vehicleNames[vsID 400]);
                        
Server(playeridmessage);
                        break;
                    }
                    
                    if(
== (MAX_ADMIN_VEHICLES 1))
                    {
                        
Server(playerid"Too many admin vehicle has been respawned, type "CHAT_YELLOW"/respawnallav "CHAT_WHITE"to respawn all admin vehicle.");
                    }
                }
            }
        }    
    }
    return 
1;

Anyone Can Fix It ?
TnX So Much For Sa-mp Forum
Reply


Messages In This Thread
Destroy Current Vehicles Help - by alishvasis - 16.08.2016, 08:23
Re: Destroy Current Vehicles Help - by Sew_Sumi - 16.08.2016, 08:56
Re: Destroy Current Vehicles Help - by alishvasis - 16.08.2016, 09:17
Re: Destroy Current Vehicles Help - by Sew_Sumi - 16.08.2016, 12:25
Re: Destroy Current Vehicles Help - by alishvasis - 16.08.2016, 12:29
Re: Destroy Current Vehicles Help - by Shinja - 16.08.2016, 13:42
Re: Destroy Current Vehicles Help - by alishvasis - 17.08.2016, 07:57
Re: Destroy Current Vehicles Help - by alishvasis - 17.08.2016, 09:01
Re: Destroy Current Vehicles Help - by Sew_Sumi - 17.08.2016, 09:13
Re: Destroy Current Vehicles Help - by alishvasis - 17.08.2016, 09:20

Forum Jump:


Users browsing this thread: 3 Guest(s)