SA-MP Forums Archive
[fixed] - 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: [fixed] (/showthread.php?tid=65720)



[fixed] - skaTim - 15.02.2009

Quote:

// skaTim [>- Name on/off
#include <a_samp>
//====================
#define COLOR_ORANGE 0xFF9900AA
//====================
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/namesoff", true) == 0)
{
for(new a=0; a<MAX_PLAYERS; a++)
{
ShowPlayerNameTagForPlayer(playerid, a, false);
}
SendClientMessage(playerid, COLOR_ORANGE, "You have sucessfully turned Name off. Type /nameson To Turn Them Back On!");
return 1;
}

if(strcmp(cmdtext, "/nameson", true) == 0)
{
for(new a=0; a<MAX_PLAYERS; a++)
{
ShowPlayerNameTagForPlayer(playerid, a, true);
}
SendClientMessage(playerid, COLOR_ORANGE, "You have sucessfully turned Name on!");
return 1;
}

Код:
D:\Scripts!\skaTim Mafia Role-Play\nameoff.pwn(27) : error 030: compound statement not closed at the end of file (started at line 8)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: /nameoff [error] - member - 15.02.2009

You were missing a brace and forgot to return a value. Follow it carefully. You would have seen it if you properly indented this.

Here you go:

pawn Код:
// skaTim [>- Name on/off
#include <a_samp>
//====================
#define COLOR_ORANGE 0xFF9900AA
//====================
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/namesoff", true) == 0)
    {
        for(new a=0; a<MAX_PLAYERS; a++)
        {
            ShowPlayerNameTagForPlayer(playerid, a, false);
        }
        SendClientMessage(playerid, COLOR_ORANGE, "You have sucessfully turned Name off. Type /nameson To Turn Them Back On!");
        return 1;
    }

    if(strcmp(cmdtext, "/nameson", true) == 0)
    {
        for(new a=0; a<MAX_PLAYERS; a++)
        {
            ShowPlayerNameTagForPlayer(playerid, a, true);
        }
        SendClientMessage(playerid, COLOR_ORANGE, "You have sucessfully turned Name on!");
        return 1;
    }
    return 1;
}



Re: /nameoff [error] - skaTim - 15.02.2009

Thanks a lot [B2K]Hustler


Re: [fixed] - razawork - 14.06.2010

Skatim ^^