cmd unban help
#1

pawn Код:
CMD:unban(playerid,params[]){
    if(PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid, red, "ERROR: You must be logged in to use this commands");
    if(PlayerInfo[playerid][Level] >= 5) return SendClientMessage(playerid, red, "ERROR: You are not a high enough level to use this command");
    new tname[24],filestring[79];
    if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /unban [playername]");
    format(filestring, sizeof(filestring), "/ladmin/users/%s.save", tname);
    if(!udb_Exists(tname(filestring)) return SendClientMessage(playerid,red, "The name you've chosen was not found in our database");
    CMDMessageToAdmins(playerid,"UNBAN");
    if(udb_Exists(tname(filestring)) udb_encode(tname(filestring));
    if(dUserINT(tname(filestring)).("banned") == 1) dUserSetINT(tname(filestring)).("banned",0);
    new done[128];
    format(done, sizeof(done),"Player %s has been unbanned", tname);
    SaveToFile("UnBanLog",done);
    SendClientMessage(playerid, white,done);
    return 1;}
here is the errors I got :

(6629) : error 012: invalid function call, not a valid address
(6629) : warning 215: expression has no effect
(6629) : error 001: expected token: ";", but found ")"
(6629) : error 029: invalid expression, assumed zero
(6629) : fatal error 107: too many error messages on one line

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


4 Errors.

Line 6629: if(!udb_Exists(tname(filestring)) return SendClientMessage(playerid,red, "The name you've chosen was not
Reply
#2

Deleted.
Reply
#3

I did but nah same error ...
Reply
#4

so any other suggestions ?
Reply
#5

tname is an empty array.

I mean since you've created tname, I've never seen GetPlayerName anywhere in your code.

Moreover, I don't use udb system. If this doesn't matter for udb that an empty array is used, i'm sorry for my useless post.
Reply
#6

pawn Код:
new name[MAX_PLAYERS_NAME];
tname = GetPlayerName(playerid, name, sizeof(name));
Reply
#7

dude don't worry, but can you gemme an unban cmd for udb am just homeless :/
Reply
#8

Quote:
Originally Posted by Ramoboss
Посмотреть сообщение
pawn Код:
new name[MAX_PLAYERS_NAME];
tname = GetPlayerName(playerid, name, sizeof(name));
TRY MY SOLUTION --'
Reply
#9

Quote:
Originally Posted by Ramoboss
Посмотреть сообщение
pawn Код:
new name[MAX_PLAYERS_NAME];
tname = GetPlayerName(playerid, name, sizeof(name));
TRY MY SOLUTION DUDE --'

EDIT: sorry for double post, fucking mouse !
Reply
#10

(6627) : warning 219: local variable "name" shadows a variable at a preceding level
(6627) : error 017: undefined symbol "MAX_PLAYERS_NAME"
(6627) : error 009: invalid array size (negative, zero or out of bounds)
(6627) : error 036: empty statement
(6627) : fatal error 107: too many error messages on one line

........................
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)