Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Funções: (Include)
- ShowPlayerDynamicMap
- HidePlayerDynamicMap
- IsPlayerInDynamicMap
- By KoloradO
- */
- static
- bool:map_Show [MAX_PLAYERS],
- Text:map_Td1,
- Text:map_Td2,
- Text:map_Td3,
- Text:map_Td4,
- PlayerText:map_Td5 [MAX_PLAYERS] = {PlayerText:INVALID_TEXT_DRAW, ...},
- PlayerText:map_Td6 [MAX_PLAYERS] = {PlayerText:INVALID_TEXT_DRAW, ...};
- /*
- Callbacks
- */
- public OnGameModeInit()
- {
- map_Td1 = TextDrawCreate(124.000000, 115.866737, "samaps:gtasamapbit1");
- TextDrawLetterSize(map_Td1, 0.000000, 0.000000);
- TextDrawTextSize(map_Td1, 201.411544, 164.149963);
- TextDrawAlignment(map_Td1, 1);
- TextDrawColor(map_Td1, -1);
- TextDrawSetShadow(map_Td1, 0);
- TextDrawSetOutline(map_Td1, 0);
- TextDrawFont(map_Td1, 4);
- map_Td2 = TextDrawCreate(325.470428, 116.283416, "samaps:gtasamapbit2");
- TextDrawLetterSize(map_Td2, 0.000000, 0.000000);
- TextDrawTextSize(map_Td2, 201.411544, 164.149963);
- TextDrawAlignment(map_Td2, 1);
- TextDrawColor(map_Td2, -1);
- TextDrawSetShadow(map_Td2, 0);
- TextDrawSetOutline(map_Td2, 0);
- TextDrawFont(map_Td2, 4);
- map_Td3 = TextDrawCreate(123.646942, 280.033386, "samaps:gtasamapbit3");
- TextDrawLetterSize(map_Td3, 0.000000, 0.000000);
- TextDrawTextSize(map_Td3, 201.411544, 164.149963);
- TextDrawAlignment(map_Td3, 1);
- TextDrawColor(map_Td3, -1);
- TextDrawSetShadow(map_Td3, 0);
- TextDrawSetOutline(map_Td3, 0);
- TextDrawFont(map_Td3, 4);
- map_Td4 = TextDrawCreate(325.117431, 280.450103, "samaps:gtasamapbit4");
- TextDrawLetterSize(map_Td4, 0.000000, 0.000000);
- TextDrawTextSize(map_Td4, 201.411544, 164.149963);
- TextDrawAlignment(map_Td4, 1);
- TextDrawColor(map_Td4, -1);
- TextDrawSetShadow(map_Td4, 0);
- TextDrawSetOutline(map_Td4, 0);
- TextDrawFont(map_Td4, 4);
- SetTimer("UpdateMapPosition", 500, true); //Timer
- #if defined mAP_OnGameModeInit
- return mAP_OnGameModeInit();
- #else
- return 1;
- #endif
- }
- forward UpdateMapPosition();
- public UpdateMapPosition()
- {
- for (new i = 0; i < MAX_PLAYERS; i++)
- {
- if(map_Show[i] && IsPlayerConnected(i))
- {
- new Float:x, Float:y, Float:z, name[MAX_PLAYER_NAME], string[MAX_PLAYER_NAME + 7];
- GetPlayerPos(i, x, y, z);
- GetPlayerName(i, name, 24);
- format(string, sizeof(string), "%s (%d)", name, i);
- new Float:map_x = 126.000000 + 402.352966 * (x + 3000.0) / 6000.0;
- new Float:map_y = 102.083335 + 328.999969 * (3000.0 - y) / 6000.0;
- PlayerTextDrawDestroy(i, map_Td5[i]);
- PlayerTextDrawDestroy(i, map_Td6[i]);
- map_Td5[i] = CreatePlayerTextDraw(i, map_x, map_y, string);
- PlayerTextDrawLetterSize(i, map_Td5[i], 0.285352, 1.166500);
- PlayerTextDrawAlignment(i, map_Td5[i], 2);
- PlayerTextDrawColor(i, map_Td5[i], 16711935);
- PlayerTextDrawSetShadow(i, map_Td5[i], 1);
- PlayerTextDrawSetOutline(i, map_Td5[i], 0);
- PlayerTextDrawBackgroundColor(i, map_Td5[i], 255);
- PlayerTextDrawFont(i, map_Td5[i], 1);
- PlayerTextDrawSetProportional(i, map_Td5[i], 1);
- map_Td6[i] = CreatePlayerTextDraw(i, map_x, map_y, ".");
- PlayerTextDrawLetterSize(i, map_Td6[i], 0.537059, 2.008333);
- PlayerTextDrawAlignment(i, map_Td6[i], 1);
- PlayerTextDrawColor(i, map_Td6[i], 16711935);
- PlayerTextDrawSetShadow(i, map_Td6[i], 0);
- PlayerTextDrawSetOutline(i, map_Td6[i], 1);
- PlayerTextDrawBackgroundColor(i, map_Td6[i], 51);
- PlayerTextDrawFont(i, map_Td6[i], 1);
- PlayerTextDrawSetProportional(i, map_Td6[i], 1);
- PlayerTextDrawShow(i, map_Td5[i]);
- PlayerTextDrawShow(i, map_Td6[i]);
- }
- }
- return 1;
- }
- /*
- Funções
- */
- stock ShowPlayerDynamicMap(playerid)
- {
- TextDrawShowForPlayer(playerid, map_Td1);
- TextDrawShowForPlayer(playerid, map_Td2);
- TextDrawShowForPlayer(playerid, map_Td3);
- TextDrawShowForPlayer(playerid, map_Td4);
- map_Show[playerid] = true;
- }
- stock HidePlayerDynamicMap(playerid)
- {
- TextDrawHideForPlayer(playerid, map_Td1);
- TextDrawHideForPlayer(playerid, map_Td2);
- TextDrawHideForPlayer(playerid, map_Td3);
- TextDrawHideForPlayer(playerid, map_Td4);
- PlayerTextDrawDestroy(playerid, map_Td5[playerid]);
- PlayerTextDrawDestroy(playerid, map_Td6[playerid]);
- map_Show[playerid] = false;
- }
- stock IsPlayerInDynamicMap(playerid)
- {
- return map_Show[playerid];
- }
- /*
- Hooks
- */
- #if defined _ALS_OnGameModeInit
- #undef OnGameModeInit
- #else
- #define _ALS_OnGameModeInit
- #endif
- #define OnGameModeInit mAP_OnGameModeInit
- #if defined mAP_OnGameModeInit
- forward mAP_OnGameModeInit();
- #endif
Advertisement
Add Comment
Please, Sign In to add comment