[Ajuda] Key - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Key (
/showthread.php?tid=447273)
Key -
StringBR - 29.06.2013
pawn Код:
if ((newkeys & KEY_YES) && !(oldkeys & KEY_YES) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if (IsPlayerConnected(playerid) && APlayerData[playerid][LoggedIn] == true)
{
if (IsPlayerInAnyVehicle(playerid))
{
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, engine, VEHICLE_PARAMS_ON, false, doors, bonnet, boot, objective);
}
}
}
Eu fiz isto, porйm queria que acontecesse o seguinte, eu apertava [Y] e o Farol Ligava/Desligava, mais nгo tenho idйia de como fazer, alguem me da uma forзa?
Re: Key -
mau.tito - 29.06.2013
Faz Algo assim .
pawn Код:
if ((newkeys & KEY_YES) && !(oldkeys & KEY_YES) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if (IsPlayerConnected(playerid) && APlayerData[playerid][LoggedIn] == true)
{
if (IsPlayerInAnyVehicle(playerid))
{
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(lights == VEHICLE_PARAMS_OFF)
SetVehicleParamsEx(vehicleid, engine, VEHICLE_PARAMS_ON, false, doors, bonnet, boot, objective);
if(lights == VEHICLE_PARAMS_ON)
SetVehicleParamsEx(vehicleid, engine, VEHICLE_PARAMS_OFF, false, doors, bonnet, boot, objective);
}
}
}
Desculpa do mal codigo mas to sem pawn.
Re: Key -
dPlaYer_ - 29.06.2013
pawn Код:
if(IsPlayerInAnyVehicle(playerid) && (newkeys & KEY_YES))
{
if(IsPlayerConnected(playerid) && APlayerData[playerid][LoggedIn] == true)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(lights == VEHICLE_PARAMS_OFF) SetVehicleParamsEx(vehicleid, engine, VEHICLE_PARAMS_ON, alarm, doors, bonnet, boot, objective);
if(lights == VEHICLE_PARAMS_ON) SetVehicleParamsEx(vehicleid, engine, VEHICLE_PARAMS_ON, alarm, doors, bonnet, boot, objective);
}
}