Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // allocations by DIz
- // 13.08.2015 v0.2
- new
- PlayerText: playerAllocation[MAX_PLAYERS][4];
- forward
- hideAllocation(playerid);
- stock showAllocation(playerid, Float:minX, Float:minY, Float:maxX, Float:maxY, time = -1, Float:size = 0.0, color = 0xFF0000FF) {
- if(GetPVarInt(playerid, "lookOnAllocation")) {
- for(new t; t < 4; t++)
- PlayerTextDrawDestroy(playerid, playerAllocation[playerid][t]);
- if(GetPVarType(playerid, "lookAllocationTimer") != PLAYER_VARTYPE_NONE)
- KillTimer(GetPVarInt(playerid, "lookAllocationTimer")),
- DeletePVar(playerid, "lookAllocationTimer");
- }
- playerAllocation[playerid][0] = CreatePlayerTextDraw(playerid, minX, minY, "up");
- PlayerTextDrawLetterSize (playerid, playerAllocation[playerid][0], 0.0, (size-0.2));
- PlayerTextDrawUseBox (playerid, playerAllocation[playerid][0], 1);
- PlayerTextDrawBoxColor (playerid, playerAllocation[playerid][0], color);
- PlayerTextDrawTextSize (playerid, playerAllocation[playerid][0], maxX-4.0, 0.0);
- playerAllocation[playerid][1] = CreatePlayerTextDraw(playerid, minX, maxY - (size+0.4) * 10.0, "down");
- PlayerTextDrawLetterSize (playerid, playerAllocation[playerid][1], 0.0, (size-0.2));
- PlayerTextDrawUseBox (playerid, playerAllocation[playerid][1], 1);
- PlayerTextDrawBoxColor (playerid, playerAllocation[playerid][1], color);
- PlayerTextDrawTextSize (playerid, playerAllocation[playerid][1], maxX-4.0, 0.0);
- playerAllocation[playerid][2] = CreatePlayerTextDraw(playerid, minX, minY, "left");
- PlayerTextDrawLetterSize (playerid, playerAllocation[playerid][2], 0.0, 0.111 * (maxY - minY - (size+0.4) * 10.0) - 0.3);
- PlayerTextDrawUseBox (playerid, playerAllocation[playerid][2], 1);
- PlayerTextDrawBoxColor (playerid, playerAllocation[playerid][2], color);
- PlayerTextDrawTextSize (playerid, playerAllocation[playerid][2], minX - 2.0 + size * 10, 0.0);
- playerAllocation[playerid][3] = CreatePlayerTextDraw(playerid, maxX - (size+0.2) * 10.0, minY, "right");
- PlayerTextDrawLetterSize (playerid, playerAllocation[playerid][3], 0.0, 0.111 * (maxY - minY - (size+0.4) * 10.0) - 0.3);
- PlayerTextDrawUseBox (playerid, playerAllocation[playerid][3], 1);
- PlayerTextDrawBoxColor (playerid, playerAllocation[playerid][3], color);
- PlayerTextDrawTextSize (playerid, playerAllocation[playerid][3], maxX - 4.0, 0.0);
- for(new t; t < 4; t++)
- PlayerTextDrawShow(playerid, playerAllocation[playerid][t]);
- if(time != -1)
- SetPVarInt(playerid, "lookAllocationTimer", SetTimerEx("hideAllocation", time, false, "i", playerid));
- SetPVarInt(playerid, "lookOnAllocation", 1);
- return true;
- }
- public hideAllocation(playerid) {
- for(new t; t < 4; t++)
- PlayerTextDrawDestroy(playerid, playerAllocation[playerid][t]);
- DeletePVar(playerid, "lookOnAllocation");
- DeletePVar(playerid, "lookAllocationTimer");
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement