Need help with Ban Command
#1

EDIT: Problem Solved, i just retyped the script and found the answer by my self :P

well, if anyone want to see my problem see below

Quote:
Originally Posted by problem
Hello All, this is my first post and also my first thread

this is my problem

im using this includes

pawn Код:
#include <sscanf2>
#include <foreach>
#include <YSI\y_commands>
#include <ysi/y_ini>
and i tried to make a ban command

pawn Код:
YCMD:ban(playerid, params[], help)
{
        #pragma unused help
        if(PlayerInfo[playerid][pLevel] < 4) return SCM(playerid, COLOR_YELLOW, "* Sorry, only Admins level 4+ can use Ban Command");
        new
            string[128],pplayerid, reason[48];
        if(sscanf(params, "us[48]", pplayerid, reason)) return SCM(playerid, COLOR_YELLOW, "* Usage: /ban <playerid> <reason>");
        if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Invalid Player id!");
        if(PlayerInfo[pplayerid][pLevel] > PlayerInfo[playerid][pLevel]) return SCM(playerid, COLOR_YELLOW, "* Sorry, but this Admin has a higher level than yours");
line 392 >      format(string,sizeof(string),""COLOR_RED"-Team SF [BAN]- %s has been banned by Admin %s for %s",GetName(pplayerid),GetName(playerid),reason);
        SCMTA(-1,string);
        Ban(pplayerid);
        return 1;
}
and a few defines

pawn Код:
#define IPI INVALID_PLAYER_ID
#define SCM SendClientMessage
#define SCMTA SendClientMessageToAll
and GetName stock

pawn Код:
stock GetName(playerid)
{
    new
        pName[MAX_PLAYER_NAME];

    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    return pName;
}
so when i tried to compile my script i got this errors

Код:
D:\SA-MP Server\gamemodes\Team SF.pwn(392) : error 001: expected token: "-string end-", but found "-identifier-"
D:\SA-MP Server\gamemodes\Team SF.pwn(392) : warning 215: expression has no effect
D:\SA-MP Server\gamemodes\Team SF.pwn(392) : error 001: expected token: ";", but found "-string-"
D:\SA-MP Server\gamemodes\Team SF.pwn(392) : warning 215: expression has no effect
D:\SA-MP Server\gamemodes\Team SF.pwn(392) : warning 215: expression has no effect
D:\SA-MP Server\gamemodes\Team SF.pwn(392) : error 001: expected token: ";", but found ")"
D:\SA-MP Server\gamemodes\Team SF.pwn(392) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
which me, myself couldn't fix it, so i came here to get the help,i tried many ways i've learned but still, i couldn't fix it :P

so please, help me , and afterall im new here
Reply
#2

bump
Reply
#3

Did you actually just bump after 2 minutes?
Reply
#4

see the PM and AM
Reply
#5

bump, again, why no one answer?
Reply
#6

I thought somewhere on this forum said, only bump your topic, every 12 hours.
And, maybe a few people don't like the whole YCMD codes, Just sayin'.
edit: Yea.. like anyone does 48 hours :L 12 hours is enough to not get whiners about bump times..
Reply
#7

Quote:
Originally Posted by Mike_Peterson
Посмотреть сообщение
I thought somewhere on this forum said, only bump your topic, every 12 hours.
And, maybe a few people don't like the whole YCMD codes, Just sayin'.
This is a bit off topic but just to correct Mike_Peterson. 48 hours xD
Reply
#8

SEARCH!!!!!!!!

Please search before postin'!
Reply
#9

OK, im sorry im new to here, so please understand, i won't bump before 48 hours, im just angry, with 100 views, no one helping

and for Jack, if you can find this problem on Search, i'll gave you a REP
Reply
#10

pawn Код:
format(string,sizeof(string),"-Team SF [BAN]- %s has been banned by Admin %s for %s",GetName(pplayerid),GetName(playerid),reason);
SCM(playerid, COLOR_RED,string);
Replace line 392 and 393 with this. :facepalm:
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)