12.03.2013, 02:27
Try this ?
( untested )
pawn Код:
new
Text3D: vipLabel[ MAX_PLAYERS ],
bool: viptag[ MAX_PLAYERS ];
public OnPlayerConnect( playerid )
{
vipLabel[ playerid ] = Create3DTextLabel( "VIP", 0x33FF33AA, 0.0, 0.0, 2.0, 40, 0, 0 );
return true;
}
CMD:vtag( playerid, params[ ] )
{
if ( PlayerInfo[ playerid ][ pVip ] >= 1 )
{
viptag[ playerid ] = ! viptag[ playerid ];
GameTextForPlayer( playerid,
( viptag[ playerid ] ) ? ( "~p~VIP Tag Activated" ) : ( "~r~VIP Tag Deactivated" ), 3000, 5 );
switch ( viptag[ playerid ] )
{
case true : Attach3DTextLabelToPlayer( vipLabel[ playerid ], playerid, 0.0, 0.0, 0.7 );
case false : Delete3DTextLabel( vipLabel[ playerid ] );
}
}
else return SendClientMessage( playerid, 0xFF3333AA, "ERROR: You are not a VIP!" );
return true;
}