Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- #include <sscanf>
- #define MAX_LABELS 999
- new Pickups, Labels;
- enum
- {
- iNone,
- iObjeto,
- iPickup,
- iLabel,
- iVehicle
- }
- enum pInfo
- {
- Float:pX,
- Float:pY,
- Float:pZ,
- pType,
- bool:pCriado,
- pModel,
- pVirtual
- }
- enum lInfo
- {
- Float:lX,
- Float:lY,
- Float:lZ,
- lText[128],
- bool:lCriado,
- Text3D:lLabel,
- lColor,
- lVirtual,
- Float:lDrawDistance
- }
- new PickupInfo[MAX_PICKUPS][pInfo], LabelInfo[MAX_LABELS][lInfo];
- new PlayerInfo[MAX_PLAYERS], PlayerItem[MAX_PLAYERS], bool:PlayerEdit[MAX_PLAYERS];
- public OnPlayerConnect(playerid)
- {
- return PlayerInfo[playerid] = -1;
- }
- #if defined _ALS_OnPlayerConnect
- #undef OnPlayerConnect
- #else
- #define _ALS_OnPlayerConnect
- #endif
- #define OnPlayerConnect gb_OnPlayerConnect
- forward gb_OnPlayerConnect(playerid);
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new Float:ItemPos[3], str[256];
- switch(dialogid)
- {
- case 9099:
- {
- if(!response)
- {
- return 1;
- }
- switch(listitem)
- {
- case 0:
- {
- new Float:Item[3], Float:Distance = 10000.0;
- for(new i; i < MAX_OBJECTS; i++)
- {
- GetObjectPos(playerid, Item[0], Item[1], Item[2]);
- if(GetPlayerDistanceFromPoint(playerid, Item[0], Item[1], Item[2]) < Distance)
- {
- Distance = GetPlayerDistanceFromPoint(playerid, Item[0], Item[1], Item[2]);
- PlayerInfo[playerid] = i;
- PlayerItem[playerid] = iObjeto;
- }
- }
- for(new i; i < MAX_PICKUPS; i++)
- {
- GetPickupPos(playerid, Item[0], Item[1], Item[2]);
- if(GetPlayerDistanceFromPoint(playerid, Item[0], Item[1], Item[2]) < Distance)
- {
- Distance = GetPlayerDistanceFromPoint(playerid, Item[0], Item[1], Item[2]);
- PlayerInfo[playerid] = i;
- PlayerItem[playerid] = iPickup;
- }
- }
- for(new i; i < MAX_LABELS; i++)
- {
- Get3DTextLabelPos(playerid, Item[0], Item[1], Item[2]);
- if(GetPlayerDistanceFromPoint(playerid, Item[0], Item[1], Item[2]) < Distance)
- {
- Distance = GetPlayerDistanceFromPoint(playerid, Item[0], Item[1], Item[2]);
- PlayerInfo[playerid] = i;
- PlayerItem[playerid] = iLabel;
- }
- }
- for(new i; i < MAX_VEHICLES; i++)
- {
- GetVehiclePos(playerid, Item[0], Item[1], Item[2]);
- if(GetPlayerDistanceFromPoint(playerid, Item[0], Item[1], Item[2]) < Distance)
- {
- Distance = GetPlayerDistanceFromPoint(playerid, Item[0], Item[1], Item[2]);
- PlayerInfo[playerid] = i;
- PlayerItem[playerid] = iVehicle;
- }
- }
- SetPlayerToItem(playerid);
- }
- }
- }
- case 9001:
- {
- if(!response)
- {
- return 1;
- }
- switch(listitem)
- {
- case 0:
- {
- PlayerInfo[playerid] ++;
- SetPlayerToItem(playerid);
- DestroyObject(PlayerInfo[playerid]);
- SendClientMessage(playerid, -1, "Objeto Deletado.");
- }
- case 1:
- {
- GetObjectPos(PlayerInfo[playerid], ItemPos[0], ItemPos[1], ItemPos[2]);
- format(str, sizeof(str), "OBJETO ID: %d\nPOSX: %f\nPOSY: %f\nPOSZ: %f", PlayerInfo[playerid], ItemPos[0], ItemPos[1], ItemPos[2]);
- ShowPlayerDialog(playerid, 9009, DIALOG_STYLE_MSGBOX, "Informações", str, "Confirma", "");
- }
- }
- }
- case 9002:
- {
- if(!response)
- {
- return 1;
- }
- switch(listitem)
- {
- case 0:
- {
- PlayerInfo[playerid] ++;
- SetPlayerToItem(playerid);
- DestroyPickupEx(PlayerInfo[playerid]);
- SendClientMessage(playerid, -1, "Pickup Deletado.");
- }
- case 1:
- {
- TogglePlayerControllable(playerid, 1);
- PlayerEdit[playerid] = true;
- SendClientMessage(playerid, -1, "USE: /finder [SAVE - CANCEL]");
- }
- case 2:
- {
- ShowPlayerDialog(playerid, 9007, DIALOG_STYLE_INPUT, "Change Model", "Digite o Model para o Pickup:", "Confirma", "Cancela");
- }
- case 3:
- {
- ShowPlayerDialog(playerid, 9008, DIALOG_STYLE_INPUT, "Change Type", "Digite o Type para o Pickup:", "Confirma", "Cancela");
- }
- case 4:
- {
- GetPickupPos(PlayerInfo[playerid], ItemPos[0], ItemPos[1], ItemPos[2]);
- format(str, sizeof(str), "PICKUP ID: %d\nTYPE: %d\nPOSX: %f\nPOSY: %f\nPOSZ: %f\nVirtual World: %d", PlayerInfo[playerid], PickupInfo[PlayerInfo[playerid]][pType], ItemPos[0], ItemPos[1], ItemPos[2], PickupInfo[PlayerInfo[playerid]][pVirtual]);
- ShowPlayerDialog(playerid, 9009, DIALOG_STYLE_MSGBOX, "Informações", str, "Confirma", "");
- }
- }
- }
- case 9003:
- {
- if(!response)
- {
- return 1;
- }
- switch(listitem)
- {
- case 0:
- {
- PlayerInfo[playerid] ++;
- SetPlayerToItem(playerid);
- Delete3DTextLabelEx(PlayerInfo[playerid]);
- SendClientMessage(playerid, -1, "Label Deletado.");
- }
- case 1:
- {
- TogglePlayerControllable(playerid, 1);
- PlayerEdit[playerid] = true;
- SendClientMessage(playerid, -1, "USE: /finder [SAVE - CANCEL]");
- }
- case 2:
- {
- ShowPlayerDialog(playerid, 9006, DIALOG_STYLE_INPUT, "Change Text", "Digite o Texto para o Label:", "Confirma", "Cancela");
- }
- case 3:
- {
- Get3DTextLabelPos(PlayerInfo[playerid], ItemPos[0], ItemPos[1], ItemPos[2]);
- format(str, sizeof(str), "LABEL ID: %d\nTEXT: %s\nPOSX: %f\nPOSY: %f\nPOSZ: %f\nCOR: %x\nVirtual World: %d", PlayerInfo[playerid], LabelInfo[PlayerInfo[playerid]][lText], ItemPos[0], ItemPos[1], ItemPos[2], LabelInfo[PlayerInfo[playerid]][lColor], LabelInfo[PlayerInfo[playerid]][lVirtual]);
- ShowPlayerDialog(playerid, 9009, DIALOG_STYLE_MSGBOX, "Informações", str, "Confirma", "");
- }
- }
- }
- case 9004:
- {
- if(!response)
- {
- return 1;
- }
- switch(listitem)
- {
- case 0:
- {
- PlayerInfo[playerid] ++;
- SetPlayerToItem(playerid);
- DestroyVehicle(PlayerInfo[playerid]);
- SendClientMessage(playerid, -1, "Veiculo Deletado.");
- }
- case 1:
- {
- TogglePlayerControllable(playerid, 1);
- PlayerEdit[playerid] = true;
- SendClientMessage(playerid, -1, "USE: /finder [SAVE - CANCEL]");
- }
- case 2:
- {
- SetVehicleToRespawn(PlayerInfo[playerid]);
- SendClientMessage(playerid, -1, "Veículo Spawnado.");
- }
- case 3:
- {
- GetVehiclePos(PlayerInfo[playerid], ItemPos[0], ItemPos[1], ItemPos[2]);
- format(str, sizeof(str), "VEHICLE ID: %d\nPOSX: %f\nPOSY: %f\nPOSZ: %f", PlayerInfo[playerid], ItemPos[0], ItemPos[1], ItemPos[2]);
- ShowPlayerDialog(playerid, 9009, DIALOG_STYLE_MSGBOX, "Informações", str, "Confirma", "");
- }
- }
- }
- case 9006:
- {
- Update3DTextLabelTextEx(PlayerInfo[playerid], LabelInfo[PlayerInfo[playerid]][lColor], inputtext);
- ShowPlayerDialog(playerid, 9003, DIALOG_STYLE_LIST, "Edit LABEL", "Deletar\nMover\nTexto\nInformações", "Confirma", "Cancela");
- SendClientMessage(playerid, -1, "Texto Alterado.");
- }
- case 9007:
- {
- PickupInfo[PlayerInfo[playerid]][pModel] = strval(inputtext);
- DestroyPickup(PlayerInfo[playerid]);
- CreatePickup(PickupInfo[PlayerInfo[playerid]][pModel], PickupInfo[PlayerInfo[playerid]][pType], PickupInfo[PlayerInfo[playerid]][pX], PickupInfo[PlayerInfo[playerid]][pY], PickupInfo[PlayerInfo[playerid]][pZ], PickupInfo[PlayerInfo[playerid]][pVirtual]);
- ShowPlayerDialog(playerid, 9002, DIALOG_STYLE_LIST, "Edit PICKUP", "Deletar\nMover\nModel\nType\nInformações", "Confirma", "Cancela");
- SendClientMessage(playerid, -1, "Model Alterado.");
- }
- case 9008:
- {
- PickupInfo[PlayerInfo[playerid]][pType] = strval(inputtext);
- DestroyPickup(PlayerInfo[playerid]);
- CreatePickup(PickupInfo[PlayerInfo[playerid]][pModel], PickupInfo[PlayerInfo[playerid]][pType], PickupInfo[PlayerInfo[playerid]][pX], PickupInfo[PlayerInfo[playerid]][pY], PickupInfo[PlayerInfo[playerid]][pZ], PickupInfo[PlayerInfo[playerid]][pVirtual]);
- ShowPlayerDialog(playerid, 9002, DIALOG_STYLE_LIST, "Edit PICKUP", "Deletar\nMover\nModel\nType\nInformações", "Confirma", "Cancela");
- SendClientMessage(playerid, -1, "Type Alterado.");
- }
- case 9009:
- {
- if(PlayerItem[playerid] == iObjeto)
- {
- ShowPlayerDialog(playerid, 9001, DIALOG_STYLE_LIST, "Edit OBJETO", "Deletar\nInformações", "Confirma", "Cancela");
- }
- else if(PlayerItem[playerid] == iPickup)
- {
- ShowPlayerDialog(playerid, 9002, DIALOG_STYLE_LIST, "Edit PICKUP", "Deletar\nMover\nModel\nType\nInformações", "Confirma", "Cancela");
- }
- else if(PlayerItem[playerid] == iLabel)
- {
- ShowPlayerDialog(playerid, 9003, DIALOG_STYLE_LIST, "Edit LABEL", "Deletar\nMover\nTexto\nInformações", "Confirma", "Cancela");
- }
- else if(PlayerItem[playerid] == iVehicle)
- {
- ShowPlayerDialog(playerid, 9004, DIALOG_STYLE_LIST, "Edit VEHICLE", "Deletar\nMover\nRespawn\nInformações", "Confirma", "Cancela");
- }
- }
- }
- return 0;
- }
- #if defined _ALS_OnDialogResponse
- #undef OnDialogResponse
- #else
- #define _ALS_OnDialogResponse
- #endif
- #define OnDialogResponse gb_OnDialogResponse
- forward gb_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
- forward SetPlayerToItem(playerid);
- public SetPlayerToItem(playerid)
- {
- new Float:ItemPos[3], str[256];
- if(PlayerItem[playerid] == iObjeto)
- {
- if(PlayerInfo[playerid] == MAX_OBJECTS) PlayerInfo[playerid] = 0;
- if(!IsValidObject(PlayerInfo[playerid]))
- {
- for(new i = PlayerInfo[playerid]; i < MAX_OBJECTS; i++)
- {
- PlayerInfo[playerid] = i;
- if(IsValidObject(PlayerInfo[playerid])) break;
- if(i == MAX_OBJECTS-1) PlayerInfo[playerid] = 0;
- }
- }
- GetObjectPos(PlayerInfo[playerid], ItemPos[0], ItemPos[1], ItemPos[2]);
- format(str, sizeof(str), "OBJETO ID: %d~n~POSX: %f~n~POSY: %f~n~POSZ: %f", PlayerInfo[playerid], ItemPos[0], ItemPos[1], ItemPos[2]);
- GameTextForPlayer(playerid, str, 3000, 6);
- SetPlayerPos(playerid, ItemPos[0], ItemPos[1], ItemPos[2]);
- }
- else if(PlayerItem[playerid] == iPickup)
- {
- if(PlayerInfo[playerid] == MAX_PICKUPS) PlayerInfo[playerid] = 0;
- if(PickupInfo[PlayerInfo[playerid]][pCriado] == false)
- {
- for(new i = PlayerInfo[playerid]; i < MAX_PICKUPS; i++)
- {
- PlayerInfo[playerid] = i;
- if(PickupInfo[PlayerInfo[playerid]][pCriado] == true) break;
- if(i == MAX_PICKUPS-1) PlayerInfo[playerid] = 0;
- }
- }
- GetPickupPos(PlayerInfo[playerid], ItemPos[0], ItemPos[1], ItemPos[2]);
- format(str, sizeof(str), "PICKUP ID: %d~n~MODEL: %d~n~TYPE: %d~n~POSX: %f~n~POSY: %f~n~POSZ: %f~n~Virtual World: %d", PlayerInfo[playerid], PickupInfo[PlayerInfo[playerid]][pModel], PickupInfo[PlayerInfo[playerid]][pType], ItemPos[0], ItemPos[1], ItemPos[2], PickupInfo[PlayerInfo[playerid]][pVirtual]);
- GameTextForPlayer(playerid, str, 3000, 6);
- SetPlayerPos(playerid, ItemPos[0], ItemPos[1], ItemPos[2]);
- }
- else if(PlayerItem[playerid] == iLabel)
- {
- if(PlayerInfo[playerid] == MAX_LABELS) PlayerInfo[playerid] = 0;
- if(LabelInfo[PlayerInfo[playerid]][lCriado] == false)
- {
- for(new i = PlayerInfo[playerid]; i < MAX_LABELS; i++)
- {
- PlayerInfo[playerid] = i;
- if(LabelInfo[PlayerInfo[playerid]][lCriado] == true) break;
- if(i == MAX_LABELS-1) PlayerInfo[playerid] = 0;
- }
- }
- Get3DTextLabelPos(PlayerInfo[playerid], ItemPos[0], ItemPos[1], ItemPos[2]);
- format(str, sizeof(str), "LABEL ID: %d~n~TEXT: %s~n~POSX: %f~n~POSY: %f~n~POSZ: %f~n~COR: %x~n~Virtual World: %d", PlayerInfo[playerid], LabelInfo[PlayerInfo[playerid]][lText], ItemPos[0], ItemPos[1], ItemPos[2], LabelInfo[PlayerInfo[playerid]][lColor], LabelInfo[PlayerInfo[playerid]][lVirtual]);
- GameTextForPlayer(playerid, str, 3000, 6);
- SetPlayerPos(playerid, ItemPos[0], ItemPos[1], ItemPos[2]);
- }
- else if(PlayerItem[playerid] == iVehicle)
- {
- if(PlayerInfo[playerid] == MAX_VEHICLES) PlayerInfo[playerid] = 0;
- if(GetVehicleModel(PlayerInfo[playerid]) == 0)
- {
- for(new i = PlayerInfo[playerid]; i < MAX_VEHICLES; i++)
- {
- PlayerInfo[playerid] = i;
- if(GetVehicleModel(PlayerInfo[playerid]) != 0) break;
- if(i == MAX_VEHICLES-1) PlayerInfo[playerid] = 0;
- }
- }
- GetVehiclePos(PlayerInfo[playerid], ItemPos[0], ItemPos[1], ItemPos[2]);
- PutPlayerInVehicle(playerid, PlayerInfo[playerid], 0);
- format(str, sizeof(str), "VEHICLE ID: %d~n~POSX: %f~n~POSY: %f~n~POSZ: %f", PlayerInfo[playerid], ItemPos[0], ItemPos[1], ItemPos[2]);
- GameTextForPlayer(playerid, str, 3000, 6);
- }
- return 1;
- }
- CMD:finder(playerid, params[])
- {
- new item[16];
- if(PlayerInfo[playerid] == -1 && PlayerEdit[playerid] == false)
- {
- if(sscanf(params, "s", item)) return SendClientMessage(playerid, -1, "USE: /finder [OBJETO - PICKUP - LABEL - VEHICLE - EXTRA]");
- if(strcmp("objeto", params, true, 10) == 0)
- {
- PlayerInfo[playerid] = 0;
- PlayerItem[playerid] = iObjeto;
- SetPlayerToItem(playerid);
- }
- else if(strcmp("pickup", params, true, 10) == 0)
- {
- PlayerInfo[playerid] = 0;
- PlayerItem[playerid] = iPickup;
- SetPlayerToItem(playerid);
- }
- else if(strcmp("label", params, true, 10) == 0)
- {
- PlayerInfo[playerid] = 0;
- PlayerItem[playerid] = iLabel;
- SetPlayerToItem(playerid);
- }
- else if(strcmp("vehicle", params, true, 10) == 0)
- {
- PlayerInfo[playerid] = 0;
- PlayerItem[playerid] = iVehicle;
- SetPlayerToItem(playerid);
- }
- else if(strcmp("extra", params, true, 10) == 0)
- {
- ShowPlayerDialog(playerid, 9099, DIALOG_STYLE_LIST, "Extras", "Item mais proximo", "Confirma", "Cancela");
- }
- else
- {
- SendClientMessage(playerid, -1, "USE: /finder [OBJETO - PICKUP - LABEL - VEHICLE - EXTRA]");
- }
- }
- else if(PlayerInfo[playerid] > -1 && PlayerEdit[playerid] == false)
- {
- if(sscanf(params, "s", item)) return SendClientMessage(playerid, -1, "USE: /finder [EDIT- PROXIMO - OFF - ITEM ID]");
- if(strcmp("proximo", params, true, 10) == 0)
- {
- PlayerInfo[playerid] ++;
- SetPlayerToItem(playerid);
- }
- else if(strcmp("off", params, true, 10) == 0)
- {
- PlayerInfo[playerid] = -1;
- PlayerItem[playerid] = iNone;
- SpawnPlayer(playerid);
- }
- else if(strcmp("edit", params, true, 10) == 0)
- {
- if(PlayerItem[playerid] == iObjeto)
- {
- ShowPlayerDialog(playerid, 9001, DIALOG_STYLE_LIST, "Edit OBJETO", "Deletar\nInformações", "Confirma", "Cancela");
- }
- else if(PlayerItem[playerid] == iPickup)
- {
- ShowPlayerDialog(playerid, 9002, DIALOG_STYLE_LIST, "Edit PICKUP", "Deletar\nMover\nModel\nType\nInformações", "Confirma", "Cancela");
- }
- else if(PlayerItem[playerid] == iLabel)
- {
- ShowPlayerDialog(playerid, 9003, DIALOG_STYLE_LIST, "Edit LABEL", "Deletar\nMover\nTexto\nInformações", "Confirma", "Cancela");
- }
- else if(PlayerItem[playerid] == iVehicle)
- {
- ShowPlayerDialog(playerid, 9004, DIALOG_STYLE_LIST, "Edit VEHICLE", "Deletar\nMover\nRespawn\nInformações", "Confirma", "Cancela");
- }
- }
- else
- {
- new itemid;
- if(sscanf(params, "d", itemid)) return SendClientMessage(playerid, -1, "USE: /finder [EDIT- PROXIMO - OFF - ITEM ID]");
- PlayerInfo[playerid] = itemid;
- SetPlayerToItem(playerid);
- }
- }
- else if(PlayerEdit[playerid] == true)
- {
- new option[16];
- if(sscanf(params, "s", option)) return SendClientMessage(playerid, -1, "USE: /finder [SAVE - CANCEL]");
- if(strcmp("save", params, true, 10) == 0)
- {
- new Float:Pos[3];
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- if(PlayerItem[playerid] == iPickup)
- {
- PlayerEdit[playerid] = false;
- SetPickupPos(PlayerInfo[playerid], Pos[0], Pos[1], Pos[2]);
- PlayerInfo[playerid] ++;
- SetPlayerToItem(playerid);
- ShowPlayerDialog(playerid, 9002, DIALOG_STYLE_LIST, "Edit PICKUP", "Deletar\nMover\nModel\nType\nInformações", "Confirma", "Cancela");
- }
- else if(PlayerItem[playerid] == iLabel)
- {
- PlayerEdit[playerid] = false;
- Set3DTextLabelPos(PlayerInfo[playerid], Pos[0], Pos[1], Pos[2]);
- PlayerInfo[playerid] ++;
- SetPlayerToItem(playerid);
- ShowPlayerDialog(playerid, 9003, DIALOG_STYLE_LIST, "Edit LABEL", "Deletar\nMover\nTexto\nInformações", "Confirma", "Cancela");
- }
- else if(PlayerItem[playerid] == iVehicle)
- {
- PlayerEdit[playerid] = false;
- PlayerInfo[playerid] ++;
- SetPlayerToItem(playerid);
- ShowPlayerDialog(playerid, 9004, DIALOG_STYLE_LIST, "Edit VEHICLE", "Deletar\nMover\nRespawn\nInformações", "Confirma", "Cancela");
- }
- }
- else if(strcmp("cancel", params, true, 10) == 0)
- {
- new Float:Pos[3];
- if(PlayerItem[playerid] == iPickup)
- {
- PlayerEdit[playerid] = false;
- GetPickupPos(PlayerInfo[playerid], Pos[0], Pos[1], Pos[2]);
- SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- ShowPlayerDialog(playerid, 9002, DIALOG_STYLE_LIST, "Edit PICKUP", "Deletar\nMover\nModel\nType\nInformações", "Confirma", "Cancela");
- }
- else if(PlayerItem[playerid] == iLabel)
- {
- PlayerEdit[playerid] = false;
- Get3DTextLabelPos(PlayerInfo[playerid], Pos[0], Pos[1], Pos[2]);
- SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- ShowPlayerDialog(playerid, 9003, DIALOG_STYLE_LIST, "Edit LABEL", "Deletar\nMover\nTexto\nInformações", "Confirma", "Cancela");
- }
- else if(PlayerItem[playerid] == iVehicle)
- {
- PlayerEdit[playerid] = false;
- GetVehiclePos(PlayerInfo[playerid], Pos[0], Pos[1], Pos[2]);
- SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- ShowPlayerDialog(playerid, 9004, DIALOG_STYLE_LIST, "Edit VEHICLE", "Deletar\nMover\nRespawn\nInformações", "Confirma", "Cancela");
- }
- }
- }
- return 1;
- }
- stock CreatePickupEx(model, type, Float:X, Float:Y, Float:Z, Virtualworld = 0)
- {
- PickupInfo[Pickups][pType] = type;
- PickupInfo[Pickups][pModel] = model;
- PickupInfo[Pickups][pX] = X;
- PickupInfo[Pickups][pY] = Y;
- PickupInfo[Pickups][pZ] = Z;
- PickupInfo[Pickups][pVirtual] = Virtualworld;
- PickupInfo[Pickups][pCriado] = true;
- CreatePickup(model, type, X, Y, Z, Virtualworld);
- Pickups ++;
- return Pickups-1;
- }
- stock ReturnPickupID()
- {
- return Pickups-1;
- }
- stock GetPickupPos(pickupid, &Float:X, &Float:Y, &Float:Z)
- {
- X = PickupInfo[pickupid][pX];
- Y = PickupInfo[pickupid][pY];
- Z = PickupInfo[pickupid][pZ];
- return 1;
- }
- stock SetPickupPos(pickupid, Float:X, Float:Y, Float:Z, Virtualworld = -1)
- {
- if(Virtualworld == -1) Virtualworld = PickupInfo[pickupid][pVirtual];
- PickupInfo[pickupid][pX] = X;
- PickupInfo[pickupid][pY] = Y;
- PickupInfo[pickupid][pZ] = Z;
- DestroyPickup(pickupid);
- CreatePickup(PickupInfo[pickupid][pModel], PickupInfo[pickupid][pType], X, Y, Z, Virtualworld);
- return 1;
- }
- stock DestroyPickupEx(pickupid)
- {
- PickupInfo[pickupid][pCriado] = false;
- PickupInfo[pickupid][pType] = 0;
- PickupInfo[pickupid][pModel] = 0;
- PickupInfo[pickupid][pX] = 0;
- PickupInfo[pickupid][pY] = 0;
- PickupInfo[pickupid][pZ] = 0;
- PickupInfo[pickupid][pVirtual] = 0;
- DestroyPickup(pickupid);
- return 1;
- }
- stock Create3DTextLabelEx(text[], color, Float:X, Float:Y, Float:Z, Float:DrawDistance, Virtualworld = 0, testLOS = 0)
- {
- new str[128];
- format(str, sizeof(str), "%s", text);
- LabelInfo[Labels][lText] = str;
- LabelInfo[Labels][lX] = X;
- LabelInfo[Labels][lY] = Y;
- LabelInfo[Labels][lZ] = Z;
- LabelInfo[Labels][lColor] = color;
- LabelInfo[Labels][lVirtual] = Virtualworld;
- LabelInfo[Labels][lDrawDistance] = DrawDistance;
- LabelInfo[Labels][lCriado] = true;
- LabelInfo[Labels][lLabel] = Create3DTextLabel(text, color, X, Y, Z, DrawDistance, Virtualworld, testLOS);
- Labels ++;
- return Labels-1;
- }
- stock Return3DTextLabelID()
- {
- return Labels-1;
- }
- stock Get3DTextLabelPos(labelid, &Float:X, &Float:Y, &Float:Z)
- {
- X = LabelInfo[labelid][lX];
- Y = LabelInfo[labelid][lY];
- Z = LabelInfo[labelid][lZ];
- return 1;
- }
- stock Set3DTextLabelPos(labelid, Float:X, Float:Y, Float:Z, Float:DrawDistance = -1.0, Virtualworld = -1, testLOS = 0)
- {
- if(Virtualworld == -1) Virtualworld = LabelInfo[labelid][lVirtual];
- if(DrawDistance == -1) DrawDistance = LabelInfo[labelid][lDrawDistance];
- LabelInfo[labelid][lX] = X;
- LabelInfo[labelid][lY] = Y;
- LabelInfo[labelid][lZ] = Z;
- Delete3DTextLabel(LabelInfo[labelid][lLabel]);
- LabelInfo[labelid][lLabel] = Create3DTextLabel(LabelInfo[labelid][lText], LabelInfo[labelid][lColor], X, Y, Z, DrawDistance, Virtualworld, testLOS);
- return 1;
- }
- stock Delete3DTextLabelEx(labelid)
- {
- LabelInfo[labelid][lCriado] = false;
- LabelInfo[labelid][lX] = 0;
- LabelInfo[labelid][lY] = 0;
- LabelInfo[labelid][lZ] = 0;
- LabelInfo[labelid][lVirtual] = 0;
- LabelInfo[labelid][lColor] = 0;
- LabelInfo[labelid][lDrawDistance] = 0;
- new str[128];
- format(str, sizeof(str), "");
- LabelInfo[labelid][lText] = str;
- Delete3DTextLabel(LabelInfo[labelid][lLabel]);
- return 1;
- }
- stock Update3DTextLabelTextEx(labelid, color, text[])
- {
- new str[128];
- format(str, sizeof(str), "%s", text);
- LabelInfo[labelid][lText] = str;
- Update3DTextLabelText(LabelInfo[labelid][lLabel], color, text);
- return 1;
- }
- #define Create3DTextLabel(%0) Create3DTextLabelEx(%0)
- #define Update3DTextLabelText(%0) Update3DTextLabelTextEx(%0)
- #define Delete3DTextLabel(%0) Delete3DTextLabelEx(%0)
- #define CreatePickup(%0) CreatePickupEx(%0)
- #define AddStaticPickup(%0) CreatePickupEx(%0)
- #define DestroyPickup(%0) DestroyPickupEx(%0)
- #define Text3D:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement