Command problem (rep+) -
Tanush123 - 07.01.2012
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;
}
Re: Command problem (rep+) -
Konstantinos - 07.01.2012
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;
}
Re: Command problem (rep+) -
Tanush123 - 07.01.2012
i want to make the state if they are in a car as a driver -_-
Re: Command problem (rep+) -
Konstantinos - 07.01.2012
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;
}
Re: Command problem (rep+) -
Tanush123 - 07.01.2012
wont work still, unkown command