fix kova bugs

This commit is contained in:
Lorenc Pekaj 2019-02-03 21:26:15 +11:00
parent cb853c1be5
commit f8516870c2

View File

@ -197,15 +197,18 @@ CMD:gps( playerid, params[ ] )
} }
else if ( GetPlayerState( playerid ) != PLAYER_STATE_DRIVER ) return SendError( playerid, "You have to be a driver of a vehicle to use this a command." ); else if ( GetPlayerState( playerid ) != PLAYER_STATE_DRIVER ) return SendError( playerid, "You have to be a driver of a vehicle to use this a command." );
else if ( GetPlayerInterior( playerid ) != 0 ) return SendError( playerid, "You must be outside of the interior." ); else if ( GetPlayerInterior( playerid ) != 0 ) return SendError( playerid, "You must be outside of the interior." );
else if( !strcmp( params, "atm", false, 3 ) ) { else if ( ! strcmp( params, "atm", false, 3 ) )
{
new Float: oX, Float: oY, Float: oZ; new Float: oX, Float: oY, Float: oZ;
new atmID = GetClosestATM( playerid ); new atmID = GetClosestATM( playerid );
GetATMPos( atmID, oX, oY, oZ ); GetATMPos( atmID, oX, oY, oZ );
GPS_SetPlayerWaypoint( playerid, "Closest ATM", oX, oY, oZ ); GPS_SetPlayerWaypoint( playerid, "Closest ATM", oX, oY, oZ );
SendServerMessage( playerid, ""COL_GREY"[GPS]"COL_WHITE" You have set your destination to closest atm." ); SendClientMessage( playerid, ""COL_GREY"[GPS]"COL_WHITE" You have set your destination to closest atm." );
} }
else if( !strcmp( params, "vehicle", false, 7 ) ){ else if ( ! strcmp( params, "vehicle", false, 7 ) )
{
new vehName[ 24 ]; new vehName[ 24 ];
if ( sscanf( params[ 8 ], "s[24]", vehName ) ) return SendUsage( playerid, "/gps vehicle [NAME]" ); if ( sscanf( params[ 8 ], "s[24]", vehName ) ) return SendUsage( playerid, "/gps vehicle [NAME]" );
new Float: vXp, Float: vYp, Float: vZp, vehID = GetVehicleModelFromName( vehName ); new Float: vXp, Float: vYp, Float: vZp, vehID = GetVehicleModelFromName( vehName );
@ -214,13 +217,14 @@ CMD:gps( playerid, params[ ] )
GetVehiclePos( GetClosestVehicleModel( playerid, vehID ), vXp, vYp, vZp ); GetVehiclePos( GetClosestVehicleModel( playerid, vehID ), vXp, vYp, vZp );
SendClientMessageFormatted( playerid, -1, ""COL_GREY"[GPS]"COL_WHITE" You have set your destination to closest %s", GetVehicleName( vehID ) ); SendClientMessageFormatted( playerid, -1, ""COL_GREY"[GPS]"COL_WHITE" You have set your destination to closest %s.", GetVehicleName( vehID ) );
GPS_SetPlayerWaypoint( playerid, sprintf( "Closest vehicle: %s", GetVehicleName( vehID ) ), vXp, vYp, vZp ); GPS_SetPlayerWaypoint( playerid, sprintf( "Closest %s", GetVehicleName( vehID ) ), vXp, vYp, vZp );
} }
else else
{ {
ShowPlayerDialog( playerid, DIALOG_GPS_CITY, DIALOG_STYLE_LIST, "{FFFFFF}GPS - Choose City", "San Fierro\nLas Venturas\nLos Santos", "Select", "Cancel" ); ShowPlayerDialog( playerid, DIALOG_GPS_CITY, DIALOG_STYLE_LIST, "{FFFFFF}GPS - Choose City", "San Fierro\nLas Venturas\nLos Santos", "Select", "Cancel" );
SendClientMessage( playerid, -1, ""COL_GREY"[TIP]"COL_WHITE" You can locate a vehicle model or ATM using "COL_GREY"/gps [VEHICLE/ATM]"COL_WHITE"." );
} }
return 1; return 1;
} }