13.05.2013, 12:49
Check these lines:
You are destroying the previously created text label and pickup when you write the command again. That's why you are able to create only one point. If you delete these lines;
You will be able to create multiple points - however, you must be able to destroy something that you've created later. Because of that, I suggest you to script something like this;
The code above is just for giving the idea.
pawn Код:
DestroyDynamic3DTextLabel(apt);
DestroyPickup(apt2);
apt = CreateDynamic3DTextLabel("Arrest Point\n{FFFF00}/arrest to arrest a suspect", COLOR_RED, ap[0], ap[1], ap[2], 12);
apt2 = CreatePickup(1314, 1, ap[0], ap[1], ap[2]);
pawn Код:
DestroyDynamic3DTextLabel(apt);
DestroyPickup(apt2);
pawn Код:
#define MAX_ARREST_POINTS 30 // Defining maximum arrest points.
new ArrestPoints[1][MAX_ARREST_POINTS]; // Creating our variable to store IDs, in case of you need to delete them.
new ArrestPointCount; // To keep how many arrest points have been created.
CMD:arrestpoint(playerid, params[])
{
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on Admin Duty.");
if(ArrestPointCount == MAX_ARREST_POINTS) return SendClientMessage(playerid, COLOR_GREY, "Arrest point limit has been filled!");
GetPlayerPos(playerid, ap[0], ap[1], ap[2]);
ArrestPoints[0][ArrestPointCount] = CreateDynamic3DTextLabel("Arrest Point\n{FFFF00}/arrest to arrest a suspect", COLOR_RED, ap[0], ap[1], ap[2], 12);
ArrestPoints[1][ArrestPointCount] = CreatePickup(1314, 1, ap[0], ap[1], ap[2]);
SendClientMessage(playerid, COLOR_WHITE, " You have changed the NYPD's arrest point.");
ArrestPointCount++;
return 1;
}