/rc chat help
#1

Hello
i made a commands for regular players only and i get this error when i already forward it
this is the code itself
pawn Код:
CMD:rc(playerid,params[])
{
    new string[128];
    if(GetPVarInt(playerid, "Spawned") != 1)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to be able to use this command.");
        return 1;
    }
    if(pInfo[playerid][Regularlevel] != 1);
    {
        SendClientMessage(playerid,COLOR_ERROR,"Only Regular Players can use the Regular Player chat to talk.");
        return 1;
    }
    if(!strlen(params))
    {
        SendClientMessage(playerid,COLOR_ERROR,"USAGE: /rc (Message)");
        return 1;
    }
    format(string,sizeof(string),"[REGULAR CHAT] %s(%d): %s",GetName(playerid),playerid,params);
    SendClientMessageToAllRegulars(string);
    return 1;
}
Here is the error:
Код:
C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(1185) : error 036: empty statement
C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(1190) : warning 225: unreachable code
C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(1196) : error 017: undefined symbol "SendClientMessageToAllRegulars"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#2

pawn Код:
CMD:rc(playerid,params[])
{
    new string[128];
    if(GetPVarInt(playerid, "Spawned") != 1)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to be able to use this command.");
        return 1;
    }
    if(pInfo[playerid][Regularlevel] != 1);
    {
        SendClientMessage(playerid,COLOR_ERROR,"Only Regular Players can use the Regular Player chat to talk.");
        return 1;
    }
    if(!strlen(params))
    {
        SendClientMessage(playerid,COLOR_ERROR,"USAGE: /rc (Message)");
        return 1;
    }
    format(string,sizeof(string),"[REGULAR CHAT] %s(%d): %s",GetPlayerNameEx(playerid),playerid,params);
    SendClientMessageToAllRegularsl(string);
    return 1;
}
And make stock for SendClientMessageToallregulars

EDIT : Scroll down to Emmet_ comment.
Reply
#3

pawn Код:
CMD:rc(playerid,params[])
{
    new string[128];
    if(GetPVarInt(playerid, "Spawned") != 1)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to be able to use this command.");
        return 1;
    }
    if(pInfo[playerid][Regularlevel] != 1)
    {
        SendClientMessage(playerid,COLOR_ERROR,"Only Regular Players can use the Regular Player chat to talk.");
        return 1;
    }
    if(!strlen(params))
    {
        SendClientMessage(playerid,COLOR_ERROR,"USAGE: /rc (Message)");
        return 1;
    }
    format(string,sizeof(string),"[REGULAR CHAT] %s(%d): %s",GetName(playerid),playerid,params);
    SendClientMessageToAllRegulars(string);
    return 1;
}

stock SendClientMessageToAllRegulars(const str[])
{
    for (new i = 0, j = GetMaxPlayers(); i < j; i ++) if (IsPlayerConnected(i))
    {
        if (pInfo[i][Regularlevel] != 0)
        {
            SendClientMessage(i, 0x00FF00FF, str);
        }
    }
    return 1;
}
Reply
#4

The command role is to give only regular players the message not for players
i forward it like i did
pawn Код:
forward SendClientMessageToAllRegulars(msg[]);
NVM Thanks emmet
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)