25.11.2014, 16:54
its nice. it would be cool if you could set it so instead of using /gps you could use key 'N' to bring up the dialog and it will make for quick gps when on the move. i have made a code for this here
instead of using:
use this:
Define
OnPlayerKeyStateChange
If you don't want to use it maybe it will be useful for someone else.
instead of using:
pawn Код:
CMD:gps(playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid))//Checks if player is in any vehicle
{
ShowPlayerDialog(playerid, GPS, DIALOG_STYLE_LIST, "GPS", "Los Santos\nLas Venturas\nSan Fierro", "Select", "Close"); // If player is in vehicle then shows dialog
return 1;
}
GameTextForPlayer(playerid, "~r~You're not in a vehicle", 2000, 1);// Sends a GameText if player is not in the vehicle
return 1;
}
Define
pawn Код:
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(PRESSED(KEY_NO))
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
ShowPlayerDialog(playerid, GPS, DIALOG_STYLE_LIST, "GPS", "Los Santos\nLas Venturas\nSan Fierro", "Select", "Close");
}
}
}
return 1;
}

