SA-MP Forums Archive
[HELP] /scratch - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] /scratch (/showthread.php?tid=257859)



[HELP] /scratch - joeri55 - 28.05.2011

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?


Re: [HELP] /scratch - Lorenc_ - 28.05.2011

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


Re: [HELP] /scratch - joeri55 - 28.05.2011

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;
}



Re: [HELP] /scratch - Lorenc_ - 28.05.2011

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.


Re: [HELP] /scratch - joeri55 - 28.05.2011

I've fixed it thanks for the help!