[HELP] /scratch
#1

I've made a /scratch command so people can "curve" letters in a wall for example.

How do I make a command to remove all the 3DTextLabels?

I got Delete3DTextLabel(Text3D:Scratch[playerid]); under a admin command but it only removes the last Text3D I created. How do I make a command to delete every Text3D that have been made?
Reply
#2

pawn Код:
foreach(Player, i)
{
    Delete3DTextLabel(Text3D:Scratch[i]);
}
Like that?
Reply
#3

I've slightly edited the cmd, and this came out;

Код:
C:\Users\mma\Desktop\SAMP\gamemodes\lspr.pwn(3565) : error 017: undefined symbol "foreach"
C:\Users\mma\Desktop\SAMP\gamemodes\lspr.pwn(3567) : error 017: undefined symbol "playerid"
C:\Users\mma\Desktop\SAMP\gamemodes\lspr.pwn(3570) : error 017: undefined symbol "playerid"
C:\Users\mma\Desktop\SAMP\gamemodes\lspr.pwn(22620) : error 017: undefined symbol "foreach"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Code;

Код:
command(removescratch, playerid, params[])
{
    #pragma unused params
    if(Player[playerid][AdminLevel] >= 4)
    {
        foreach(Player, playerid)
        {
            Delete3DTextLabel(Text3D:Scratch[playerid]);
        }
    }
    return 1;
}
Reply
#4

pawn Код:
command(removescratch, playerid, params[])
{
    #pragma unused params
    if(Player[playerid][AdminLevel] >= 4)
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            Delete3DTextLabel(Text3D:Scratch[i]);
        }
    }
    return 1;
}
Try that, if you had foreach (BY ******) It would be easier. I just wrote the for loop from here. Not tested.
Reply
#5

I've fixed it thanks for the help!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)