Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include < a_samp >
- #if defined _iStreamer_included
- #endinput
- #endif
- #define _iStreamer_included
- // Settings
- #define MAX_MAP_ICONS 400 // Max icons than script allows to be streamed
- #undef MAX_PLAYERS
- #define MAX_PLAYERS 50 // Change this with you current MAX_PLAYERS
- // End of Settings
- new
- iMap_ID[ MAX_PLAYERS ][ MAX_MAP_ICONS ],
- Float: fPos[ 4 ][ MAX_PLAYERS ][ MAX_MAP_ICONS ],
- iMarker_Type[ MAX_PLAYERS ][ MAX_MAP_ICONS ],
- iMap_iColour[ MAX_PLAYERS ][ MAX_MAP_ICONS ]
- ;
- stock SetPlayerStreamedIcon( playerid, Float: fX, Float: fY, Float: fZ, iType, iColour, Float: fV )
- {
- for( new i = 1; i < MAX_MAP_ICONS; i++ )
- {
- if( fPos[ 0 ][ playerid ][ i ] == 0 && fPos[ 1 ][ playerid ][ i ] == 0 )
- {
- fPos[ 0 ][ playerid ][ i ] = fX;
- fPos[ 1 ][ playerid ][ i ] = fY;
- fPos[ 2 ][ playerid ][ i ] = fZ;
- fPos[ 3 ][ playerid ][ i ] = fV;
- iMarker_Type[ playerid ][ i ] = iType;
- iMap_iColour[ playerid ][ i ] = iColour;
- UpdateStreamedMapIcons( playerid );
- return i;
- }
- }
- return false;
- }
- stock UpdateStreamedIcons( playerid )
- {
- new
- iMapIcons = 1;
- for( new i = 1; i < MAX_MAP_ICONS; i++ )
- {
- if( iMap_ID[ playerid ][ i ] > 0 )
- {
- RemovePlayerMapIcon( playerid, iMap_ID[ playerid ][ i ] );
- }
- }
- for( new i = 1; i < MAX_MAP_ICONS && iMapIcons < 100; i++ )
- {
- if( fPos[ 0 ][ playerid ][ i ] != 0 || fPos[ 1 ][ playerid ][ i ] != 0 || fPos[ 2 ][ playerid ][ i ] != 0 )
- {
- if( GetPlayerDistanceFromPoint( playerid, fPos[ 0 ][ playerid ][ i ], fPos[ 1 ][ playerid ][ i ], fPos[ 2 ][playerid][ i ] ) <= fPos[ 3 ][ playerid ][ i ] )
- {
- SetPlayerMapIcon( playerid, iMapIcons, fPos[ 0 ][ playerid ][ i ], fPos[ 1 ][ playerid ][ i ], fPos[ 2 ][ playerid ][ i ], iMarker_Type[ playerid ][ i ], iMap_iColour[ playerid ][ i ], MAPICON_GLOBAL );
- iMap_ID[ playerid ][ i ] = iMapIcons;
- iMapIcons ++;
- }
- }
- }
- return iMapIcons;
- }
- stock RemoveStreamedIcon( playerid, IconID )
- {
- fPos[ 0 ][ playerid ][ IconID ] = 0;
- fPos[ 1 ][ playerid ][ IconID ] = 0;
- fPos[ 2 ][ playerid ][ IconID ] = 0;
- fPos[ 3 ][ playerid ][ IconID ] = 0;
- iMarker_Type[ playerid ][ IconID ] = false;
- iMap_iColour[ playerid ][ IconID ] = false;
- RemovePlayerMapIcon( playerid, iMap_ID[ playerid ][ IconID ] );
- iMap_ID[ playerid ][ IconID ] = 0;
- return true;
- }
Add Comment
Please, Sign In to add comment