Please help
#1

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?
Reply
#2

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

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...
Reply
#4

Show the error line
Reply
#5

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

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;

Reply
#7

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

Show the code where you get the errors
Reply
#9

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)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)