symbol is never used: "params"
#1

I want this to to be access by level 1 admins and following levels

Код:
CMD:adcc(playerid, params[])
{
 	if(IsPlayerAdmin(playerid)) //Change this
	{
	    new strg[128];
        for(new i = 0; i < 200; i++) SendClientMessageToAll(-1," ");
	    format(strg, sizeof strg, "Admininstrator has cleared the chat!");
	    SendClientMessageToAll(COLOR_LIGHTBLUE, strg);
	}
	return 1;
}
When i do /admins no Message or dialog showing up
The admin Levels are
Код:
Trial Moderator
Moderator
Administrator
Head Administrator
Owner
if possible change it to dialog not Message

Код:
CMD:admins(playerid, params[])
{
    new pname[MAX_PLAYER_NAME], string[60];
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i) && IsPlayerAdmin(i))
        {
            GetPlayerName(i, pname, sizeof(pname));
            format(string, sizeof(string), "Admin: %s ID: %d", pname, i);
            SendClientMessage(playerid, COLOR_WHITE, string);
        }
    }
    return 1;
}
Reply
#2

this warnig is caused when a symbol is not used anywhere
for example
pawn Код:
new a,b,c;
b=5+10;
c=b+5;
in the above example we have declared variable "a" but have not use it anywhere so it will give this warning
you could just simply ignore it
Reply
#3

pawn Код:
dcmd_adcc(playerid,params[])
{
        #pragma unused params
        for(new i = 0; i < 250; i++) SendClientMessageToAll(0x00000000," ");//250 should be enough
        SendClientMessageToAll(playerid, "Admin has Cleared the Chat.");
        return 1;
}
Reply
#4

As BroZeus said, you could simply ignore it, but here is a way that should ignore the warning, by adding this inside the braces
Код:
#pragma unused params
EDIT: Looks like Jack_Leslie beat me to it within a few seconds!
Reply
#5

Fixed
Reply
#6

New problem added
Reply
#7

Код:
CMD:adcc(playerid, params[])
{
 	if(PlayerInfo[playerid][pAdmin] >= 1) //Change this
	{
	    new strg[128];
        for(new i = 0; i < 200; i++) SendClientMessageToAll(-1," ");
	    format(strg, sizeof strg, "Admininstrator has cleared the chat!");
	    SendClientMessageToAll(COLOR_LIGHTBLUE, strg);
	}
	return 1;
}
Код:
CMD:admins(playerid, params[])
{
    new pname[MAX_PLAYER_NAME], string[60],counter=0;
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            if(PlayerInfo[i][pAdmin] >= 1)
            {
            counter+=1;
            GetPlayerName(i, pname, sizeof(pname));
            format(string, sizeof(string), "Admin: %s ID: %d", pname, i);
            }
        }
    }
    if(counter != 0)
    {
    SendClientMessage(playerid, COLOR_WHITE, string);
    }
    else
    {
    SendClientMessage(playerid, COLOR_WHITE, "No Admins are Online at the moment.");
    return 1;
    }
    return 1;
}
Reply
#8

Quote:
Originally Posted by Rittik
Посмотреть сообщение
Код:
CMD:adcc(playerid, params[])
{
 	if(PlayerInfo[playerid][pAdmin] >= 1) //Change this
	{
	    new strg[128];
        for(new i = 0; i < 200; i++) SendClientMessageToAll(-1," ");
	    format(strg, sizeof strg, "Admininstrator has cleared the chat!");
	    SendClientMessageToAll(COLOR_LIGHTBLUE, strg);
	}
	return 1;
}
Код:
CMD:admins(playerid, params[])
{
    new pname[MAX_PLAYER_NAME], string[60],counter=0;
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            if(PlayerInfo[i][pAdmin] >= 1)
            {
            counter+=1;
            GetPlayerName(i, pname, sizeof(pname));
            format(string, sizeof(string), "Admin: %s ID: %d", pname, i);
            }
        }
    }
    if(counter != 0)
    {
    SendClientMessage(playerid, COLOR_WHITE, string);
    }
    else
    {
    SendClientMessage(playerid, COLOR_WHITE, "No Admins are Online at the moment.");
    return 1;
    }
    return 1;
}
PHP код:
C:\Users\Matt\Desktop\SAMP\PJS\gamemodes\PJS.pwn(5455) : error 017undefined symbol "pAdmin"
C:\Users\Matt\Desktop\SAMP\PJS\gamemodes\PJS.pwn(5485) : error 017undefined symbol "pAdmin"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
2 Errors

Reply
#9

Show your enum.
Reply
#10

Quote:
Originally Posted by Rittik
Посмотреть сообщение
Show your enum.
what is "Enum"
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)