Arrest Point
#4

Check these lines:

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]);
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;

pawn Код:
DestroyDynamic3DTextLabel(apt);
    DestroyPickup(apt2);
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;

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;
}
The code above is just for giving the idea.
Reply


Messages In This Thread
Arrest Point - by Latisha - 13.05.2013, 11:45
Re: Arrest Point - by Latisha - 13.05.2013, 12:39
Re: Arrest Point - by MP2 - 13.05.2013, 12:46
Re: Arrest Point - by Calabresi - 13.05.2013, 12:49
Re: Arrest Point - by Latisha - 13.05.2013, 12:50
Re: Arrest Point - by Calabresi - 13.05.2013, 13:00
Re: Arrest Point - by Latisha - 13.05.2013, 13:08
Re: Arrest Point - by Calabresi - 13.05.2013, 13:10
Re: Arrest Point - by Latisha - 13.05.2013, 13:15
Re: Arrest Point - by Calabresi - 13.05.2013, 13:18

Forum Jump:


Users browsing this thread: 4 Guest(s)