make /park save mods
#1

PHP код:
CMD:park(playeridparams[])
{
    if(
PlayerInfo[playerid][pVehicleKeysFrom] != INVALID_PLAYER_ID)
    {
        new 
ownerid PlayerInfo[playerid][pVehicleKeysFrom];
        if(
IsPlayerConnected(ownerid))
        {
            new 
PlayerInfo[playerid][pVehicleKeys];
            if(
IsPlayerInVehicle(playeridPlayerVehicleInfo[ownerid][d][pvId]))
            {
                if(
GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessageEx(playeridCOLOR_GREY"You must be in the driver seat.");
                new 
Float:xFloat:yFloat:zFloat:angleFloat:health;
                
GetVehicleHealth(PlayerVehicleInfo[ownerid][d][pvId], health);
                if(
health 800) return SendClientMessageEx(playeridCOLOR_GREY" Your vehicle is too damaged to park it.");
                if(
PlayerInfo[playerid][pLockCar] == GetPlayerVehicleID(playerid)) PlayerInfo[playerid][pLockCar] = INVALID_VEHICLE_ID;
                if(
IsARC(GetPlayerVehicleID(playerid))) // RC Vehicles
                
{
                    new 
Float:vehPos[3];
                    
GetVehiclePos(GetPlayerVehicleID(playerid),vehPos[0], vehPos[1], vehPos[2]);
                    
SetPlayerPos(playerid,vehPos[0], vehPos[1]+0.5vehPos[2]+0.5);
                }
                
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 has parked %s's vehicle."GetPlayerNameEx(playerid), GetPlayerNameEx(ownerid));
                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                return 
1;
            }
        }
    }
    for(new 
MAX_PLAYERVEHICLESd++)
    {
        if(
IsPlayerInVehicle(playeridPlayerVehicleInfo[playerid][d][pvId]))
        {
            new 
Float:xFloat:yFloat:zFloat:angleFloat:health;
            
GetVehicleHealth(PlayerVehicleInfo[playerid][d][pvId], health);
            if(
GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessageEx(playeridCOLOR_GREY"You must be in the driver seat.");
            if(
health 800) return SendClientMessageEx(playeridCOLOR_GREY" Your vehicle is too damaged to park it.");
            if(
PlayerInfo[playerid][pLockCar] == GetPlayerVehicleID(playerid)) PlayerInfo[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 has parked their vehicle."GetPlayerNameEx(playerid));
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            return 
1;
        }
    }
    
SendClientMessageEx(playeridCOLOR_GREY"You need to be inside a vehicle that you own.");
    return 
1;

Reply


Messages In This Thread
make /park save mods - by matthew1211 - 17.06.2013, 00:42
Re: make /park save mods - by park4bmx - 17.06.2013, 00:59
Re: make /park save mods - by matthew1211 - 17.06.2013, 02:37

Forum Jump:


Users browsing this thread: 1 Guest(s)