SA-MP Forums Archive
Server Unknown Command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Server Unknown Command (/showthread.php?tid=385480)



Server Unknown Command - Abreezy - 16.10.2012

Fixed.


Re: Server Unknown Command - BlueGames - 16.10.2012

You have any "GetVehicleParamsEx" stock?


Re: Server Unknown Command - Abreezy - 16.10.2012

No, why would I? It's already included:

https://sampwiki.blast.hk/wiki/GetVehicleParamsEx


AW: Server Unknown Command - BiosMarcel - 16.10.2012

delete this Message


AW: Server Unknown Command - BiosMarcel - 16.10.2012

PHP код:
CMD:lock(playeridparams[])
{
    
#pragma unused paramst6
    
new vid GetPlayerVehicleID(playerid);
    new 
model GetVehicleModel(vid);
    new 
string[128];
    new 
Float:XFloat:YFloat:Z;
    
GetPlayerPos(playeridXYZ);
    if(
IsPlayerInAnyVehicle(playerid))
    {
        
GetVehicleParamsEx(videnginelightsalarmdoorsbonnetbootobjective);
        if(
doors == 0)
        {
               
SetVehicleParamsEx(vid,engine,lights,alarm,1,bonnet,boot,objective);
               
format(stringsizeof(string), "* %s presses the button on the door panel, locking the %s. *"pName2(playerid),VehicleNames[model-400]);
            
SendLocalMessage(playeridstring10.0COLOR_PURPLECOLOR_PURPLE);
        }
        else if(
doors == 1)
        {
            
SetVehicleParamsEx(vid,engine,lights,alarm,0,bonnet,boot,objective);
            
format(stringsizeof(string), "* %s presses the button on the door panel, unlocking the %s. *"pName2(playerid),VehicleNames[model-400]);
            
SendLocalMessage(playeridstring10.0COLOR_PURPLECOLOR_PURPLE);
        }
    }
    else
    {
        new 
nearest GetNearestVehicle(playerid15.0);
        new 
models GetVehicleModel(nearest);
        if(
nearest 0)
        {
            
SendClientMessage(playeridCOLOR_WHITE"> Your remote can't reach the vehicle, get closer.");
        }
        else if(
nearest >= 0)
        {
            
GetVehicleParamsEx(nearestenginelightsalarmdoorsbonnetbootobjective);
            if(
doors == 0)
            {
                
format(stringsizeof(string), "* %s takes their keys out, pressing the button, locking the %s. *"pName2(playerid), VehicleNames[models-400]);
                
SendLocalMessage(playeridstring10.0COLOR_PURPLECOLOR_PURPLE);
                
SetVehicleParamsEx(nearest,engine,lights,alarm,1,bonnet,boot,objective);
            }
            else if(
doors == 1)
            {
                
SetVehicleParamsEx(nearest,engine,lights,alarm,0,bonnet,boot,objective);
                
format(stringsizeof(string), "* %s presses the button on the door panel, unlocking the %s. *"pName2(playerid), VehicleNames[models-400]);
                
SendLocalMessage(playeridstring10.0COLOR_PURPLECOLOR_PURPLE);
            }
        }
    }
    return 
1;




Re: Server Unknown Command - Abreezy - 16.10.2012

Still the same issue.


Re: Server Unknown Command - Abreezy - 16.10.2012

With the use of

PHP код:
if(nearest 0
        { 
            
SendClientMessage(playeridCOLOR_WHITE"> Your remote can't reach the vehicle, get closer."); 
        } 
It still gives me the issue I originally had.


AW: Server Unknown Command - BiosMarcel - 16.10.2012

Now ?

PHP код:
CMD:lock(playeridparams[])
{
    
#pragma unused paramst6
    
new vid GetPlayerVehicleID(playerid);
    new 
model GetVehicleModel(vid);
    new 
string[128];
    new 
Float:XFloat:YFloat:Z;
    
GetPlayerPos(playeridXYZ);
    if(
IsPlayerInAnyVehicle(playerid))
    {
        
GetVehicleParamsEx(videnginelightsalarmdoorsbonnetbootobjective);
        if(
doors == 0)
        {
               
SetVehicleParamsEx(vid,engine,lights,alarm,1,bonnet,boot,objective);
               
format(stringsizeof(string), "* %s presses the button on the door panel, locking the %s. *"pName2(playerid),VehicleNames[model-400]);
            
SendLocalMessage(playeridstring10.0COLOR_PURPLECOLOR_PURPLE);
        }
        else if(
doors == 1)
        {
            
SetVehicleParamsEx(vid,engine,lights,alarm,0,bonnet,boot,objective);
            
format(stringsizeof(string), "* %s presses the button on the door panel, unlocking the %s. *"pName2(playerid),VehicleNames[model-400]);
            
SendLocalMessage(playeridstring10.0COLOR_PURPLECOLOR_PURPLE);
        }
    }
    else
    {
        new 
nearest GetNearestVehicle(playerid15.0);
        new 
models GetVehicleModel(nearest);
        if(!
nearest >= 0)
        {
            
SendClientMessage(playeridCOLOR_WHITE"> Your remote can't reach the vehicle, get closer.");
        }
        else if(
nearest >= 0)
        {
            
GetVehicleParamsEx(nearestenginelightsalarmdoorsbonnetbootobjective);
            if(
doors == 0)
            {
                
format(stringsizeof(string), "* %s takes their keys out, pressing the button, locking the %s. *"pName2(playerid), VehicleNames[models-400]);
                
SendLocalMessage(playeridstring10.0COLOR_PURPLECOLOR_PURPLE);
                
SetVehicleParamsEx(nearest,engine,lights,alarm,1,bonnet,boot,objective);
            }
            else if(
doors == 1)
            {
                
SetVehicleParamsEx(nearest,engine,lights,alarm,0,bonnet,boot,objective);
                
format(stringsizeof(string), "* %s presses the button on the door panel, unlocking the %s. *"pName2(playerid), VehicleNames[models-400]);
                
SendLocalMessage(playeridstring10.0COLOR_PURPLECOLOR_PURPLE);
            }
        }
    }
    return 
1;




Re: Server Unknown Command - Randy More - 16.10.2012

Not sure if this is the issue, but try instead of having..

pawn Код:
if(nearest == 0)
having..

pawn Код:
if(nearest == INVALID_VEHICLE_ID) // Since 0 is not the invalid ID for the vehicles.



Re: Server Unknown Command - Abreezy - 16.10.2012

Still the same issue.

Edit: Trying above.