SA-MP Forums Archive
Engine Upgrade - 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: Engine Upgrade (/showthread.php?tid=515211)



Engine Upgrade - cedizon - 25.05.2014

Can you guys upgrade my /engine command to , if they /engine if they don't have keys they can't start the engine?? i need help Please

pawn Код:
CMD:engine(playerid, params[])
{
    if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new vehicleid, string[128];
        vehicleid = GetPlayerVehicleID(playerid);
        if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
        GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
        if(engine == VEHICLE_PARAMS_ON)
        {
            SetVehicleEngine(vehicleid, playerid);
        }
        else if((engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET))
        {
            SetTimerEx("SetVehicleEngine", 2000, 0, "dd",  vehicleid, playerid);
            if(PlayerInfo[playerid][pMask] == 1) { format(string, sizeof(string), "Stranger has successfully started their Vehicle engine"); }
            else { format(string, sizeof(string), "* %s has successfully started their Vehicle engine",  GetPlayerNameEx(playerid)); }
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        }
    }
    return 1;
}



Re: Engine Upgrade - Mr_Zlodei - 25.05.2014

PHP код:
CMD:engine(playeridparams[])
{
    if(
IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        if(!
PlayerInfo[playerid][pCarKey] ) return 1;// вот так вот
        
new vehicleidstring[128];
        
vehicleid GetPlayerVehicleID(playerid);
        if(
GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
        
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
        if(
engine == VEHICLE_PARAMS_ON)
        {
            
SetVehicleEngine(vehicleidplayerid);
        }
        else if((
engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET))
        {
            
SetTimerEx("SetVehicleEngine"20000"dd",  vehicleidplayerid);
            if(
PlayerInfo[playerid][pMask] == 1) { format(stringsizeof(string), "Stranger has successfully started their Vehicle engine"); }
            else { 
format(stringsizeof(string), "* %s has successfully started their Vehicle engine",  GetPlayerNameEx(playerid)); }
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        }
    }
    return 
1;




Re: Engine Upgrade - admiralspeedy - 25.05.2014

I don't think this is really a place to ask for people to do stuff for you.