Need Help
#2

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/lock"cmdtexttrue10) == 0)
    {
        if(
gPlayerLogged[playerid] == 0) return SendClientMessage(playeridCOLOR_LIGHTRED"You need to login first.");
    if(
IsPlayerConnected(playerid))
    {
        new 
engine,lights,alarm,doors,bonnet,boot,objective;
        if(
SwitchKey[playerid] == 1)
        {
            new 
string[100];
             if(
personalcar[playerid] != 0)
              {
                if(
CheckPlayerDistanceToVehicle(5.0playeridpersonalcar[playerid]))
                {
                     if(
CarInfo[OwnedVeh(personalcar[playerid])][cLock] == 1)
                      {
                        
GetVehicleParamsEx(personalcar[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
                          
SetVehicleParamsEx(personalcar[playerid],engine,lights,alarm,0,bonnet,boot,objective);
                        
format(stringsizeof(string), "~h~%s~n~~g~Unlocked",CarInfo[OwnedVeh(personalcar[playerid])][cDescription]);
                        
GameTextForPlayer(playeridstring40004);
                        
CarInfo[OwnedVeh(personalcar[playerid])][cLock] = 0;
                        
gCarLock[personalcar[playerid]] = 0;
                        
vUpdate(OwnedVeh(personalcar[playerid]), cLockx); //
                        
return 1;
                    }
                    else if(
CarInfo[OwnedVeh(personalcar[playerid])][cLock] == 0)
                    {
                        
GetVehicleParamsEx(personalcar[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
                          
SetVehicleParamsEx(personalcar[playerid],engine,lights,alarm,1,bonnet,boot,objective);
                        
format(stringsizeof(string), "~h~%s~n~~r~Locked",CarInfo[OwnedVeh(personalcar[playerid])][cDescription]);
                        
GameTextForPlayer(playeridstring40004);
                        
CarInfo[OwnedVeh(personalcar[playerid])][cLock] = 1;
                        
gCarLock[personalcar[playerid]] = 1;
                        
vUpdate(OwnedVeh(personalcar[playerid]), cLockx); //
                        
return 1;
                    }
                }
                else return 
SendClientMessage(playeridCOLOR_WHITE"{FFB870}Your vehicle not near you.");
             }
            else return 
SendClientMessage(playeridCOLOR_WHITE"{FFB870}You don't have a vehicle.");
        }
        else if(
SwitchKey[playerid] == 2)
        {
            new 
carid,string[128];
            if(
HireCar[playerid] == -1) return SCM(playerid,COLOR_WHITE,"{FFB870}You do not have a rental car/boat/bike/scooter already.");
            if(
HireCar[playerid] != -1)
            {
                
carid HireCar[playerid];
            }
            if(
CheckPlayerDistanceToVehicle(5.0playeridHireCar[playerid]))
            {
                if(
gCarLock[carid] == 0)
                {
                    new 
vehicles GetVehicleModel(carid) - 400;
                    
format(stringsizeof(string), "~h~%s~n~~r~Locked"aVehicleNames[vehicles]);
                    
GameTextForPlayer(playeridstring40004);
                      
PlayerPlaySound(playerid11450.00.00.0);
                    
gCarLock[carid] = 1;
                    
GetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
                      
SetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,1,bonnet,boot,objective);
                    return 
1;
                }
                else if(
gCarLock[carid] == 1)
                {
                    new 
vehicles GetVehicleModel(carid) - 400;
                    
format(stringsizeof(string), "~h~%s~n~~g~Unlocked"aVehicleNames[vehicles]);
                    
GameTextForPlayer(playeridstring40004);
                    
PlayerPlaySound(playerid11450.00.00.0);
                    
gCarLock[carid] = 0;
                    
GetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
                      
SetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,0,bonnet,boot,objective);
                    return 
1;
                }
            }
        }
    }
    return 
1;

Reply


Messages In This Thread
Need Help - by ongnung147 - 30.08.2016, 06:53
Re: Need Help - by ongnung147 - 30.08.2016, 06:59

Forum Jump:


Users browsing this thread: 1 Guest(s)