10.03.2012, 18:02
Don't use 256 for string value when the max on SA-MP is 128.
Max Name Length is 20, not 60.
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;
}