[FilterScript] Simple GPS
#6

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:
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;
}
use this:

Define
pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
OnPlayerKeyStateChange
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;
}
If you don't want to use it maybe it will be useful for someone else.
Reply


Messages In This Thread
Simple GPS - by LeXuZ - 24.11.2014, 19:35
Re: Simple GPS - by LeXuZ - 24.11.2014, 20:01
AW: Simple GPS - by Flori - 24.11.2014, 20:04
Re: Simple GPS - by LeXuZ - 24.11.2014, 20:07
Re: Simple GPS - by UltraScripter - 25.11.2014, 16:36
Re: Simple GPS - by Jakwob - 25.11.2014, 16:54
Re: Simple GPS - by LeXuZ - 25.11.2014, 16:59
Re: Simple GPS - by Ryz - 25.11.2014, 17:01
Re: Simple GPS - by LeXuZ - 26.11.2014, 16:18

Forum Jump:


Users browsing this thread: 1 Guest(s)