Help at Car Commands
#1

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
Reply
#2

https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
https://sampwiki.blast.hk/wiki/GetPlayerKeys
Reply
#3

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.
Reply
#4

i will try
Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)