Ban command problem
#1

Hello everyone,

Today I have written a ban command but it is giving me a strange error which I could not fix by myself, hopefully you could help me out:

Код:
YCMD:ban(playerid, params[], help)
{
        #pragma unused help
        if(P_Data[playerid][pAdmin] == 0) return SCM(playerid, COLOR_RED, "* You are not authorized to use this command!");
        new
			string[128],pplayerid, reason[48];
        if(sscanf(params, "us[48]", pplayerid, reason)) return SCM(playerid, COLOR_RED, "Usage: /ban [Player ID/Player Name] [Reason]");
        if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
		if(P_Data[pplayerid][pAdmin] == 5) return SCM(playerid, COLOR_RED, "You cannot ban an admin level 5");
		format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"is ban player "COL_WHITE"%s  "COL_RED"Reason: %s",GetName(playerid),GetName(pplayerid),reason);
        SCMToAll(-1,string);
		Bans(playerid,pplayerid,reason);
        Ban(pplayerid);
        return 1;
}
Errors:
Quote:

undefined symbol "@yC_ban"
undefined symbol "@yC_ban"
error 017: undefined symbol "@_yCban"
fatal error 107: too many error messages on one li

Exact line:
Код:
YCMD:ban(playerid, params[], help)
Reply
#2

Have you include ycmd include ?
Reply
#3

Quote:
Originally Posted by Galletziz
Посмотреть сообщение
Have you include ycmd include ?
Yes I do.
Reply
#4

Have you another command above YCMD:ban?
Reply
#5

Yes I do:

Код:
YCMD:ask(playerid, params[], help)
{
        #pragma unused help
        new
			string[128], text[48];
        if(sscanf(params, "s[48]", text)) return SCM(playerid, COLOR_RED, "Usage: /ask [text]");
        foreach(Player, i) {
        if(P_Data[i][pAdmin] > 0) {
        format(string,sizeof(string),""COL_RED"[Question] Player"COL_WHITE"%s |"COL_RED"Text: "COL_WHITE"%s ",GetName(playerid),text);
        SCM(i,-1,string);
        return 1;
}
Reply
#6

You didn't close 2 brackets in the above command.

You don't need sscanf for that, it can be:
pawn Код:
YCMD:ask(playerid, params[], help)
{
    #pragma unused help
    if (isnull(params)) return SCM(playerid, COLOR_RED, "Usage: /ask [text]");
    new string[144];
    format(string, sizeof (string), ""COL_RED"[Question] Player"COL_WHITE"%s |"COL_RED"Text: "COL_WHITE"%s ", GetName(playerid), params);
    foreach(Player, i) if (P_Data[i][pAdmin] > 0) SCM(i, -1, string);
    return 1;
}
Reply
#7

Have u closed ur cmd using this bracket '}' after return 1:
Reply
#8

hello, I'm player of the server (as you can see)
I would like to report what happened to me ...
I was playing normally ..
until when ..
the server was "out of control"
and players have lost the connection ..
I was relogging ..
and when relog, my account was banned (CHAVES1, RANK 27)
I tried to use other accounts ..
i could not get ..
I wonder what happened and if possible, please release my account ..
wish I could play again. Thank you.

CHAVES1.
Reply
#9

U r posting at wrong place u need to inform them via pm otherwise u will be able to get infra.. Chaves1
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)