3D Text Label Destroy
#1

pawn Код:
new rand;

CMD:setgang(playerid, params[])
{
    new string[256], name[60], leader;
    rand = 1000 + random(25000);
    new Float:x, Float:y, Float:z;
    if(sscanf(params, "us[60]", leader, name[59])) return SCM(playerid, COLOR_LIGHTRED, "USAGE: /setgang [Gang Leader (playername/id)] [Gang Name]");
    if(!IsPlayerConnected(leader)) return SCM(playerid, COLOR_LIGHTRED, "[SERVER]: Invalid PlayerID!");
    GetPlayerPos(playerid, x, y, z);
    rand = CreateDynamicPickup(1239, 1, x, y, z);
    format(string, sizeof(string), "[Official Gang Information] \n [Gang ID: %d] \n [Gang Name: %s] \n [Gang Leader: %s]", rand, name[59], GetPlayerNameEx(leader));
    CreateDynamic3DTextLabel(string, COLOR_LIGHTBLUE, x, y, z, 15);
    return 1;
}

CMD:unsetgang(playerid, params[])
{
    new string[256];
    if(sscanf(params, "d", rand)) return SCM(playerid, COLOR_LIGHTRED, "USAGE: /unsetgang [Gang ID]");
    DestroyDynamicPickup(rand);
    format(string, sizeof(string), "You have unset gang-id: %d.", rand);
    SCM(playerid, COLOR_LIGHTRED, string);
    return 1;
}
I've tried for hours, to get this thing to work, and it's refusing, and I'm clueless... It destroys the pickup okay, on all ID's. Issue I'm having is, if I spawn one (ID 800), then spawn another, and try to destroy both, it'll only destroy 801. It doesn't see 800?

How would I make it so I can remove the text label on unset?

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)