how to make in key a cmd?
#1

well, a lots players saying me to make engine and light in key, I made them in cmd, any one know how to make in key?
pawn Код:
if(strcmp(cmd, "/engine", true) == 0)
    {
    if(!IsPlayerInAnyVehicle(playerid)) return scm(playerid,c_r,"( ! ) You're not in any vehicle to use /engine");
    new vehicle = GetPlayerVehicleID(playerid);
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
    if(engine != 0)
    {
    SetVehicleParamsEx(vehicle,false,lights,alarm,doors,bonnet,boot,objective);
    scm(playerid,COLOR_GREEN,"( ! ) Engine is off !");
    return 1;
    }
    else if(engine != 1 && Gas[vehicle] == 0) return scm(playerid,c_r,"( ! ) This doesn't have fuel for switch on the engine !");
    else if(engine != 1 && Gas[vehicle] != 0)
    {
    SetVehicleParamsEx(vehicle,true,lights,alarm,doors,bonnet,boot,objective);
    scm(playerid,COLOR_GREEN,"( ! ) Engine is on !");
    }
    return 1;
    }
Reply
#2

guys ! help plz
Reply
#3

use OnPlayerKeyStateChange....
this will help ya:
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
and this for a list of keys:
https://sampwiki.blast.hk/wiki/GetPlayerKeys

hope i helped you out a bit
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)