SA-MP Forums Archive
Would this work? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Would this work? (/showthread.php?tid=275985)



Would this work? - Shockey HD - 11.08.2011

pawn Код:
CMD:engine(playerid,params[])
{
    new vid;
    vid = GetPlayerVehicleID(playerid);
    new engine,lights,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet,boot,objective);
    SCM(playerid,COLOR_LIGHTRED,"Your vehicle has started!");
    return 1;
}
I currently cant test it right now but would it work.

Also, Can someone explain to me what the bonnet,boot,objective is?


Re: Would this work? - antonio112 - 11.08.2011

Yes, that would work.

bonnet = hood
boot = trunk
objective = the yellow arrow on top of the vehicle


Re: Would this work? - Shockey HD - 11.08.2011

Quote:
Originally Posted by antonio112
Посмотреть сообщение
Yes, that would work.

bonnet = hood
boot = trunk
objective = the yellow arrow on top of the vehicle
Okay thank you. One more thing. I want to do /engine to turn on, and /engine to turn off. How would i do so.

Heres my code.

pawn Код:
CMD:engine(playerid,params[])
{
    new vid;
    vid = GetPlayerVehicleID(playerid);
    new engine,lights,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,true,lights,alarm,doors,bonnet,boot,objective);
    SCM(playerid,COLOR_LIGHTRED,"The Vehicle Has Started!");
        return 1;
}
SCM is SendClientMessage


Re: Would this work? - Onyewu - 11.08.2011

Try this:

pawn Код:
CMD:engine(playerid,params[])
{
    new vid;
    vid = GetPlayerVehicleID(playerid);
    new engine,lights,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);

    if (engine) {
        SetVehicleParamsEx(vid,0,lights,alarm,doors,bonnet,boot,objective);
        SCM(playerid,COLOR_LIGHTRED,"Engine shut down!");
    } else {
        SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet,boot,objective);
        SCM(playerid,COLOR_LIGHTRED,"The Vehicle Has Started!");
    }

    return 1;
}



Re: Would this work? - Shockey HD - 11.08.2011

Quote:
Originally Posted by Onyewu
Посмотреть сообщение
Try this:

pawn Код:
CMD:engine(playerid,params[])
{
    new vid;
    vid = GetPlayerVehicleID(playerid);
    new engine,lights,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);

    if (engine) {
        SetVehicleParamsEx(vid,0,lights,alarm,doors,bonnet,boot,objective);
        SCM(playerid,COLOR_LIGHTRED,"Engine shut down!");
    } else {
        SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet,boot,objective);
        SCM(playerid,COLOR_LIGHTRED,"The Vehicle Has Started!");
    }

    return 1;
}
Okay, And Finally, (I know im a pain)

How can i disable the real chat. Not really disable it fully but it only sends to players that are near


Re: Would this work? - PrawkC - 11.08.2011

return 0 onplayertext


Re: Would this work? - antonio112 - 11.08.2011

No.
pawn Код:
public OnPlayerText(playerid, text[])
{
    new String[128], name[24], Float:X, Float:Y, Float:Z;
        GetPlayerName(playerid, name, sizeof name);
        GetPlayerPos(playerid, X, Y, Z);
    format(String, sizeof String, "%s says: %s", name, text);
        foreach (Player,i)
        {
               if(IsPlayerInRangeOfPoint(i, 30, X, Y, Z))
               {
                     SendClientMessage(i, -1, String);
                     return 1;
               }
        }
    return 0;
}
Something like that