Saving Vehicle Position
#1

So in my gamemode if you want to save your car you need to type /Estacionar (/Park) so that will save the car position so when you comeback you type /llaves (/key) and you choose your car and it will spawn where you type /estacionar (Park)

What i want is that it get save without typing /estacionar (/park)

Maybe with a timer.

here is the /estacionar script

PHP код:
CMD:estacionar(playeridparams[])
{
    if(
Info[playerid][pVehicleKeysFrom] != INVALID_PLAYER_ID)
    {
        new 
ownerid Info[playerid][pVehicleKeysFrom];
        if(
IsPlayerConnected(ownerid))
        {
            new 
Info[playerid][pVehicleKeys];
            if(
IsPlayerInVehicle(playeridPlayerVehicleInfo[ownerid][d][pvId]))
            {
                if(
GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessageEx(playeridCOLOR_GREY"Tu debes ser el conductor.");
                new 
Float:xFloat:yFloat:zFloat:angleFloat:health;
                
GetVehicleHealth(PlayerVehicleInfo[ownerid][d][pvId], health);
                
PlayerVehicleInfo[ownerid][d][pvHealth] = health;
                
//if(health < 800) return SendClientMessageEx(playerid, COLOR_GREY, " Tu vehнculo estб demasiado daсado para estacionarlo.");
                
if(Info[playerid][pLockCar] == GetPlayerVehicleID(playerid)) Info[playerid][pLockCar] = INVALID_VEHICLE_ID;
                
GetVehiclePos(PlayerVehicleInfo[ownerid][d][pvId], xyz);
                
GetVehicleZAngle(PlayerVehicleInfo[ownerid][d][pvId], angle);
                
SurfingCheck(GetPlayerVehicleID(playerid));
                
UpdatePlayerVehicleParkPosition(owneriddxyzanglehealth);
                
PutPlayerInVehicle(playeridGetPlayerVehicleID(playerid), 0);
                 
SetPlayerArmedWeapon(playerid0);
                new 
string[29 + (MAX_PLAYER_NAME 2)];
                
format(stringsizeof(string), "* %s ha estacionado el vehiculo de %s."GetPlayerNameEx(playerid), GetPlayerNameEx(ownerid));
                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                
fVehSpeed[playerid] = 0.0;
                return 
1;
            }
        }
    }
    for(new 
MAX_PLAYERVEHICLESd++)
    {
        if(
IsPlayerInVehicle(playeridPlayerVehicleInfo[playerid][d][pvId]))
        {
            if(
GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessageEx(playeridCOLOR_GREY"Tu debes ser el conductor.");
            new 
Float:xFloat:yFloat:zFloat:angleFloat:health;
            
GetVehicleHealth(PlayerVehicleInfo[playerid][d][pvId], health);
            
PlayerVehicleInfo[playerid][d][pvHealth] = health;
            
//if(health < 800) return SendClientMessageEx(playerid, COLOR_GREY, " Tu vehiculo estб muy daсado para estacionarlo.");
            
if(Info[playerid][pLockCar] == GetPlayerVehicleID(playerid)) Info[playerid][pLockCar] = INVALID_VEHICLE_ID;
            
GetVehiclePos(PlayerVehicleInfo[playerid][d][pvId], xyz);
            
GetVehicleZAngle(PlayerVehicleInfo[playerid][d][pvId], angle);
            
SurfingCheck(GetPlayerVehicleID(playerid));
            
UpdatePlayerVehicleParkPosition(playeriddxyzanglehealth);
            
PutPlayerInVehicle(playeridPlayerVehicleInfo[playerid][d][pvId], 0);
            
SetPlayerArmedWeapon(playerid0);
            new 
string[30 + (MAX_PLAYER_NAME 2)];
            
format(stringsizeof(string), "* %s ha estacionado su vehiculo."GetPlayerNameEx(playerid));
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
fVehSpeed[playerid] = 0.0;
            return 
1;
        }
    }
    
SendClientMessageEx(playeridCOLOR_GREY"Tu necesitas estar dentro de tu vehiculo para hacer esto.");
    return 
1;

Reply
#2

What ?
Reply
#3

que quiere que te expliqie
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)