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(playerid, params[])
{
    
#pragma unused paramst6
    
new vid = GetPlayerVehicleID(playerid);
    new 
model = GetVehicleModel(vid);
    new 
string[128];
    new 
Float:X, Float:Y, Float:Z;
    
GetPlayerPos(playerid, X, Y, Z);
    if(
IsPlayerInAnyVehicle(playerid))
    {
        
GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
        if(
doors == 0)
        {
               
SetVehicleParamsEx(vid,engine,lights,alarm,1,bonnet,boot,objective);
               
format(string, sizeof(string), "* %s presses the button on the door panel, locking the %s. *", pName2(playerid),VehicleNames[model-400]);
            
SendLocalMessage(playerid, string, 10.0, COLOR_PURPLE, COLOR_PURPLE);
        }
        else if(
doors == 1)
        {
            
SetVehicleParamsEx(vid,engine,lights,alarm,0,bonnet,boot,objective);
            
format(string, sizeof(string), "* %s presses the button on the door panel, unlocking the %s. *", pName2(playerid),VehicleNames[model-400]);
            
SendLocalMessage(playerid, string, 10.0, COLOR_PURPLE, COLOR_PURPLE);
        }
    }
    else
    {
        new 
nearest = GetNearestVehicle(playerid, 15.0);
        new 
models = GetVehicleModel(nearest);
        if(
nearest < 0)
        {
            
SendClientMessage(playerid, COLOR_WHITE, "> Your remote can't reach the vehicle, get closer.");
        }
        else if(
nearest >= 0)
        {
            
GetVehicleParamsEx(nearest, engine, lights, alarm, doors, bonnet, boot, objective);
            if(
doors == 0)
            {
                
format(string, sizeof(string), "* %s takes their keys out, pressing the button, locking the %s. *", pName2(playerid), VehicleNames[models-400]);
                
SendLocalMessage(playerid, string, 10.0, COLOR_PURPLE, COLOR_PURPLE);
                
SetVehicleParamsEx(nearest,engine,lights,alarm,1,bonnet,boot,objective);
            }
            else if(
doors == 1)
            {
                
SetVehicleParamsEx(nearest,engine,lights,alarm,0,bonnet,boot,objective);
                
format(string, sizeof(string), "* %s presses the button on the door panel, unlocking the %s. *", pName2(playerid), VehicleNames[models-400]);
                
SendLocalMessage(playerid, string, 10.0, COLOR_PURPLE, COLOR_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(playerid, COLOR_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(playerid, params[])
{
    
#pragma unused paramst6
    
new vid = GetPlayerVehicleID(playerid);
    new 
model = GetVehicleModel(vid);
    new 
string[128];
    new 
Float:X, Float:Y, Float:Z;
    
GetPlayerPos(playerid, X, Y, Z);
    if(
IsPlayerInAnyVehicle(playerid))
    {
        
GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
        if(
doors == 0)
        {
               
SetVehicleParamsEx(vid,engine,lights,alarm,1,bonnet,boot,objective);
               
format(string, sizeof(string), "* %s presses the button on the door panel, locking the %s. *", pName2(playerid),VehicleNames[model-400]);
            
SendLocalMessage(playerid, string, 10.0, COLOR_PURPLE, COLOR_PURPLE);
        }
        else if(
doors == 1)
        {
            
SetVehicleParamsEx(vid,engine,lights,alarm,0,bonnet,boot,objective);
            
format(string, sizeof(string), "* %s presses the button on the door panel, unlocking the %s. *", pName2(playerid),VehicleNames[model-400]);
            
SendLocalMessage(playerid, string, 10.0, COLOR_PURPLE, COLOR_PURPLE);
        }
    }
    else
    {
        new 
nearest = GetNearestVehicle(playerid, 15.0);
        new 
models = GetVehicleModel(nearest);
        if(!
nearest >= 0)
        {
            
SendClientMessage(playerid, COLOR_WHITE, "> Your remote can't reach the vehicle, get closer.");
        }
        else if(
nearest >= 0)
        {
            
GetVehicleParamsEx(nearest, engine, lights, alarm, doors, bonnet, boot, objective);
            if(
doors == 0)
            {
                
format(string, sizeof(string), "* %s takes their keys out, pressing the button, locking the %s. *", pName2(playerid), VehicleNames[models-400]);
                
SendLocalMessage(playerid, string, 10.0, COLOR_PURPLE, COLOR_PURPLE);
                
SetVehicleParamsEx(nearest,engine,lights,alarm,1,bonnet,boot,objective);
            }
            else if(
doors == 1)
            {
                
SetVehicleParamsEx(nearest,engine,lights,alarm,0,bonnet,boot,objective);
                
format(string, sizeof(string), "* %s presses the button on the door panel, unlocking the %s. *", pName2(playerid), VehicleNames[models-400]);
                
SendLocalMessage(playerid, string, 10.0, COLOR_PURPLE, COLOR_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.