Please help me!!!
#1

LOL this is so funny,as if I want to drive I have to keep pressed button 2 also or the engine goes off(xDD);So what's worng?

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
       new vehicleid=GetPlayerVehicleID(playerid);
       SetVehicleParamsEx(vehicleid,0,0,0,0,0,0,0);
       GameTextForPlayer(playerid,"Press 2 to turn engine on",2500,4);
       if(PRESSED(KEY_SUBMISSION))
       {
          SetVehicleParamsEx(vehicleid,1,0,0,0,0,0,0);
          SendClientMessage(playerid,BLUE,"The engine is turned on.");
       }
     }
       
    return 1;
}
Reply
#2

use public OnPlayerKeyStateChange
The script you've got now, says you have to keep 2 pressed to drive, indeed.

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

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
       new vehicleid=GetPlayerVehicleID(playerid);
       SetVehicleParamsEx(vehicleid,0,0,0,0,0,0,0);
       GameTextForPlayer(playerid,"Press 2 to turn engine on",2500,4);
       if(newkeys & KEY_SUBMISSION)
       {
          SetVehicleParamsEx(vehicleid,1,0,0,0,0,0,0);
          SendClientMessage(playerid,BLUE,"The engine is turned on.");
       }
     }
       
    return 1;
}
that should work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)