Vehicle Respawn problem
#1

Anyone knows how to set vehicle respawn off in this code? But only for spawned vehicles by admins not for static vehicles!

PHP код:
dcmd_v(playeridparams[])
{
    if(
IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdminLevel] > 0)
    {
        new 
idx,modelid;
        new 
tmp[256],string[256];
        
tmp strtok(paramsidx);
        if(!
strlen(tmp))
        {
            
SendClientMessage(playeridCOLOR_ERROR"USAGE: /v (Modelid/Name)");
            return 
1;
        }
        
        
        if(
isNumeric(tmp))
        {
        
modelid strval(tmp);
        
        }else{
        
modelid GetVehicleModelIDFromNametmp );
        if( 
modelid == -)
        {
        
SendClientMessage(playeridCOLOR_ERROR"[ERROR] Invalid MODELID/NAME");
        return 
1;
        }
        }
        if(
modelid 400 || modelid 611)
        {
        
SendClientMessage(playeridCOLOR_ERROR"Enter A Vehicle Modelid Between 400 And 611");
        return 
1;
        }
        new 
Float:XFloat:YFloat:ZFloat:A;//,Interior,World;
        
GetPlayerPos(playeridXYZ);
        
GetPlayerFacingAngle(playeridA);
        
//Interior = GetPlayerInterior(playerid);
        //World = GetPlayerVirtualWorld(playerid);
        
GetXYInFrontOfPlayer(playeridXY5.0);
        
CreateVehicle(modelidX,Y,2.0,90.0,-1,-1,1000);
        
format(stringsizeof(string), "%s Spawned A (%s), Modelid: (%d)"PlayerInfo[playerid][pName], aVehicleNames[modelid 400], modelid);
}else{
    
SendClientMessage(playeridCOLOR_ERROR"Unknown Command! Type /cmds For Available Commands.");
    }
    return 
1;

PHP код:
public OnVehicleDeath(vehicleidkillerid)
{
    new 
string[256];
    if (
CarInfo[vehicleid][cOwned] > -1)
    {
    new 
playerid CarInfo[vehicleid][cOwned];
    
PlayerInfo[playerid][pCar] = 0;
    }
    
format(stringsizeof(string), "Not Owned");
    
strmid(CarInfo[vehicleid][cOwner], string0strlen(string), 256);
    
CarInfo[vehicleid][cOwned] = -1;
    
CarInfo[vehicleid][cLock] = 0;
    
CarInfo[vehicleid][cSold] = 0;
    
CarInfo[vehicleid][cValue] = 0;
    return 
1;

PHP код:
public OnVehicleSpawn(vehicleid)
{
    new 
string[256];
    if (
CarInfo[vehicleid][cOwned] > -1)
    {
    new 
playerid CarInfo[vehicleid][cOwned];
    
PlayerInfo[playerid][pCar] = 0;
    }
    
format(stringsizeof(string), "Not Owned");
    
strmid(CarInfo[vehicleid][cOwner], string0strlen(string), 256);
    
CarInfo[vehicleid][cOwned] = -1;
    
CarInfo[vehicleid][cLock] = 0;
    
CarInfo[vehicleid][cSold] = 0;
    
CarInfo[vehicleid][cValue] = 0;
    return 
1;

What should I add and where?
Reputation included for help
Reply


Messages In This Thread
Vehicle Respawn problem - by DarknesS1988 - 21.09.2017, 14:17
Re: Vehicle Respawn problem - by Zedder - 21.09.2017, 14:40
Re: Vehicle Respawn problem - by DarknesS1988 - 21.09.2017, 17:54

Forum Jump:


Users browsing this thread: 1 Guest(s)