26.10.2010, 02:17
how can I fix this, cause I am a 1337 on my server and it tells me this crap when I try and /kick or /ban, please help me fix this.
It's not in my script I've been scripting since late 08' I'm just Introduced to this 0.3b scripting and it's a bit confusing for me, I just gotta get the hang of it, but if it's required to /rcon login to /ban or /kick someone then I guess that's how it's gonna work. I'm not sharing my /ban or /kick command cause their custom.
|
if(strcmp(cmd, "/ban", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ban [playerid/PartOfName] [reason]"); return 1; } giveplayerid = ReturnUser(tmp); if (PlayerInfo[playerid][pAdmin] >= 2) { if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[264]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ban [playerid/PartOfName] [reason]"); return 1; } new year, month,day; getdate(year, month, day); format(string, sizeof(string), "Notice: %s was banned by %s, reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year); BanLog(string); format(string, sizeof(string), "Notice: %s was banned by an admin, reason: %s", giveplayer, (result)); SendClientMessageToAll(COLOR_LIGHTRED, string); format(string, sizeof(string), "Notice: %s was banned by %s", giveplayer, sendername); ABroadCast(COLOR_YELLOW,string,1); PlayerInfo[giveplayerid][pBanned] = 1; Ban(giveplayerid); return 1; } }//not connected } else { format(string, sizeof(string), " %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_GRAD1, string); } } return 1; }