SA-MP Forums Archive
Please help - 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)
+--- Thread: Please help (/showthread.php?tid=614545)



Please help - DarkElement - 09.08.2016

So I wanted to make a disable clan chat command on a RPG server, and I have some errors

That's the code
Код:
CMD:togc(playerid,params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(IsPlayerConnected(playerid))
    {
        if (pClan[playerid])
        {
            pClan[playerid] = 1;
            SendClientMessage(playerid, COLOR_GRAD1, "Clan chat channel Disabled.");
        }
        else if (pClan[playerid])
        {
            pClan[playerid] = 0;
            SendClientMessage(playerid, COLOR_GRAD1, "Clan chat channel Enabled.");
        }
    }
    return 1;
}
And there are the errors: http://imgur.com/a/3S6AG

Can you fix it pls?


Re: Please help - Luicy. - 09.08.2016

You don't have a pClan int, add new pClan[MAX_PLAYERS]; on top of your gamemode.


Re: Please help - DarkElement - 09.08.2016

Quote:
Originally Posted by Luicy.
Посмотреть сообщение
You don't have a pClan int, add new pClan[MAX_PLAYERS]; on top of your gamemode.
I already added it, and it gave me errors...


Re: Please help - Whatname - 09.08.2016

Show the error line


Re: Please help - DarkElement - 09.08.2016

Quote:
Originally Posted by Whatname
Посмотреть сообщение
Show the error line
The error after adding pClan[MAX_PLAYERS] ?


Re: Please help - Whatname - 09.08.2016

PHP код:
CMD:togc(playerid,params[])
{
    new 
pClan[MAX_PLAYERS];
    if(
gPlayerLogged[playerid] == 0) return SendClientMessage(playeridCOLOR_LIGHTRED"You need to login first.");
    if(
IsPlayerConnected(playerid))
    {
        if (
pClan[playerid] == 0)
        {
            
pClan[playerid] = 1;
            
SendClientMessage(playeridCOLOR_GRAD1"Clan chat channel Disabled.");
        }
        else if (
pClan[playerid] == 1)
        {
            
pClan[playerid] = 0;
            
SendClientMessage(playeridCOLOR_GRAD1"Clan chat channel Enabled.");
        }
    }
    return 
1;




Re: Please help - DarkElement - 09.08.2016

Quote:
Originally Posted by Whatname
Посмотреть сообщение
Show the error line
There it is:http://imgur.com/a/aOurS


Re: Please help - Whatname - 09.08.2016

Show the code where you get the errors


Re: Please help - K0P - 09.08.2016

You are definitely using an enum but wrong way.

EDIT: Remove that pClan[MAX_PLAYERS]; var from your script,its causing these errors,the fix is very simple,just show me the emun and its definition and i will fix it.Or just open pawn and press CTRL+F and type "pClan[" then press F3 button 5-6 times and select that whole line then show us that line. (Can't explain here why you have to do that,just do as i said :C)