SA-MP Forums Archive
Help at Car Commands - 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: Help at Car Commands (/showthread.php?tid=280952)



Help at Car Commands - CaTaLinU - 03.09.2011

I have a FilterScript - Car Commands

You can see it here http://pastebin.com/Cy63Fwc6

The engine starts just if you write /engine on
But i want to start when you press W Key (movement button)

Can Someone help me


Re: Help at Car Commands - =WoR=Varth - 03.09.2011

https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
https://sampwiki.blast.hk/wiki/GetPlayerKeys


Re: Help at Car Commands - Da' J' - 03.09.2011

pawn Код:
#
dcmd_engine(playerid,params[]){
#
        #pragma unused params
#
        if(IsPlayerConnected(playerid)){
#
                if(!strlen(params)) return SendClientMessage(playerid, COLOR_WHITE, "[COMANDA]: /engine [on/off]");
                if(newkeys == KEY_JUMP)
#
                new vehicle = GetPlayerVehicleID(playerid);
#
            if(strcmp(params,"on",true) == 0) {
#
                        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
#
                                if(Vehicle[vehicle][Engine] == 0) { GameTextForPlayer(playerid,"~W~Incerci sa pornesti motorul",3000,3); SetTimerEx("TurnOnEngine", MAX_START_TIME*1000, 0, "dd", playerid, vehicle); }
#
                        } }
#
            if(strcmp(params,"off",true) == 0) { TurnOffEngine(playerid, vehicle); }
#
        }
#
        return true;
#
}
I would try out that. Did put there
pawn Код:
if(newkeys == KEY_JUMP)
after the /engine command. If it ain't working, try to place it somewhere else.

Ps. KEY_JUMP means space (or shift, my jumpkey is space), so it'll start with /engine or space with that. Just change the KEY_JUMP into KEY_W or something like that.


Re: Help at Car Commands - CaTaLinU - 03.09.2011

i will try


Re: Help at Car Commands - CaTaLinU - 03.09.2011

Sorry for double

but i got 6 errors



F:\PWN\FSpeed.pwn(669) : error 017: undefined symbol "newkeys"
F:\PWN\FSpeed.pwn(670) : error 003: declaration of a local variable must appear in a compound block
F:\PWN\FSpeed.pwn(670) : error 017: undefined symbol "vehicle"
F:\PWN\FSpeed.pwn(673) : error 017: undefined symbol "vehicle"
F:\PWN\FSpeed.pwn(673) : error 017: undefined symbol "vehicle"
F:\PWN\FSpeed.pwn(675) : error 017: undefined symbol "vehicle"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


6 Errors.