GetPlayerDistanceFromPoint
#3

Don't use 256 for string value when the max on SA-MP is 128.
Max Name Length is 20, not 60.
pawn Код:
CMD:i( playerid, params[ ] )
{
    new ID, string[ 128 ], string2[ 128 ], name[ MAX_PLAYER_NAME ], Float:p_x, Float:p_y, Float:p_z;
    if( sscanf( params, "u", ID ) ) return SendClientMessage( playerid, COLOR_WHITE, "USAGE: /i [id]" );
    if( IsPlayerConnected( ID ) == 0) return SendClientMessage( playerid, COLOR_RED, "Player is not connected!" );
    GetPlayerName( ID, name, MAX_PLAYER_NAME );
    GetPlayerPos( ID, p_x, p_y, p_z );
    // Do Something;
    GetPlayerDistanceFromPoint( ID, p_x, p_y, p_z );
    new carid = GetPlayerVehicleID( ID );
    TextDrawShowForPlayer( playerid, text44 );
    TextDrawShowForPlayer( playerid, text45 );
    TextDrawShowForPlayer( playerid, PCBOX );
    if( !IsPlayerInAnyVehicle( ID ) )
    {
        format( string, 128, "~y~Player Info: ~r~~h~%s[%d]~n~~n~~g~Location:~w~%s~n~~g~Money:~w~%d~n~~g~Wanted Level:~w~%d~n~~g~Drive:~w~none", name, ID, ReturnPlayerZone( ID ), GetPlayerMoney( ID ), GetPlayerWantedLevel( ID ) );
    }
    else
    {
        format( string, 128, "~y~Player Info: ~r~~h~%s[%d]~n~~n~~g~Location:~w~%s~n~~g~Wanted Level:~w~%d~n~~g~Vehicle:~w~%s", name, ID, ReturnPlayerZone( ID ), GetPlayerWantedLevel( ID ), VehicleNames[ GetVehicleModel( carid ) - 400 ] );
    }
    TextDrawSetString( text44, string );
    format( string2, 128, "~n~~n~~n~~n~~n~~n~~n~~w~Type ~r~~h~LMB ~w~For Hide These~n~~w~Boxes!" );
    TextDrawSetString( text45, string2 );
    return 1;
}
Reply


Messages In This Thread
GetDistanceBetweenPlayers +rep - by SnG.Scot_MisCuDI - 10.03.2012, 17:40
Re: GetPlayerDistanceFromPoint - by IstuntmanI - 10.03.2012, 17:55
Re: GetPlayerDistanceFromPoint - by Konstantinos - 10.03.2012, 18:02
Re: GetPlayerDistanceFromPoint - by SnG.Scot_MisCuDI - 10.03.2012, 19:40
Re: GetPlayerDistanceFromPoint - by SnG.Scot_MisCuDI - 10.03.2012, 21:58
Re: GetPlayerDistanceFromPoint - by [ABK]Antonio - 10.03.2012, 22:26
Re: GetPlayerDistanceFromPoint - by SnG.Scot_MisCuDI - 10.03.2012, 22:28
Re: GetPlayerDistanceFromPoint - by eesh - 11.03.2012, 03:50
Re: GetPlayerDistanceFromPoint - by SnG.Scot_MisCuDI - 11.03.2012, 06:48

Forum Jump:


Users browsing this thread: 2 Guest(s)