Command problem (rep+)
#1

Well i was making /engine and when i use it outside a car it shows you are not driving a car (that works good) but when i enter a car as a driver and use it, it returns 0 to me
pawn Код:
CMD:engine(playerid, params[])
{
    if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid,red,"ERROR: You are not driving a vehicle!");
    new vid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(vengine[vid] == 0)
    {
        SetVehicleParamsEx( vid,1, lights, alarm, doors, bonnet, boot, objective );
        SendClientMessage(playerid,orange,"You have turned on your vehicle engine!");
        vengine[vid] = 1;
    }
    else if(vengine[vid] == 1)
    {
        SetVehicleParamsEx( vid,0, lights, alarm, doors, bonnet, boot, objective );
        SendClientMessage(playerid,orange,"You have turned off your vehicle engine!");
        vengine[vid] = 0;
    }
    return 1;
}
Reply
#2

pawn Код:
CMD:engine(playerid, params[])
{
    if(GetPlayerState(playerid) != 0) return SendClientMessage(playerid,red,"ERROR: You are not driving a vehicle!");
    new vid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(vengine[vid] == 0)
    {
        SetVehicleParamsEx( vid,1, lights, alarm, doors, bonnet, boot, objective );
        SendClientMessage(playerid,orange,"You have turned on your vehicle engine!");
        vengine[vid] = 1;
    }
    else if(vengine[vid] == 1)
    {
        SetVehicleParamsEx( vid,0, lights, alarm, doors, bonnet, boot, objective );
        SendClientMessage(playerid,orange,"You have turned off your vehicle engine!");
        vengine[vid] = 0;
    }
    return 1;
}
Reply
#3

i want to make the state if they are in a car as a driver -_-
Reply
#4

I did a mistake on Player's seat. I am really not sure why this happens.
pawn Код:
CMD:engine(playerid, params[])
{
    new playerState = GetPlayerState(playerid);
    if(playerState != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,red,"ERROR: You are not driving a vehicle!");
    new vid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(vengine[vid] == 0)
    {
        SetVehicleParamsEx( vid,1, lights, alarm, doors, bonnet, boot, objective );
        SendClientMessage(playerid,orange,"You have turned on your vehicle engine!");
        vengine[vid] = 1;
    }
    else if(vengine[vid] == 1)
    {
        SetVehicleParamsEx( vid,0, lights, alarm, doors, bonnet, boot, objective );
        SendClientMessage(playerid,orange,"You have turned off your vehicle engine!");
        vengine[vid] = 0;
    }
    return 1;
}
Reply
#5

wont work still, unkown command
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)