[SOLVED]2 Errors ?
#1

Okay, this is the non-working piece of my unbanname command.
Can anyone help me to fix the errors?
I just worked more then 1 hour on it.

pawn Код:
...
unbanname = strval(tmp);

if(udb_Exists(unbanname))   {    //5411
dUserSetINT(unbanname).("banned", 0);  //5412
...
Код:
(5411) : error 035: argument type mismatch (argument 1)
(5412) : error 035: argument type mismatch (argument 1)
I would be happy about a working solution, or some help-tries.
Reply
#2

if(udb_Exists(unbanname)) need two ) becouse you open 2...
and i dont have ideo for other.
Reply
#3

Quote:
Originally Posted by skynny
if(udb_Exists(unbanname)) need two ) becouse you open 2...
and i dont have ideo for other.
Same errors.

I updated first post with the one )
Reply
#4

Anyone can help me?
Reply
#5

Quote:
Originally Posted by Jeffry
Okay, this is the non-working piece of my unbanname command.
Can anyone help me to fix the errors?
I just worked more then 1 hour on it.

pawn Код:
...
unbanname = strval(tmp);

if(udb_Exists(unbanname))   {    //5411
dUserSetINT(unbanname).("banned", 0);  //5412
...
Код:
(5411) : error 035: argument type mismatch (argument 1)
(5412) : error 035: argument type mismatch (argument 1)
I would be happy about a working solution, or some help-tries.
Is Name a INT?
pawn Код:
...
unbanname = strval(tmp);
...
I think you mean:
pawn Код:
unbanname = tmp;
Reply
#6

Lol, sorry, cant answer this, but here is the command.

pawn Код:
dcmd_unbanname(playerid,params[]) {
    if(PlayerInfo[playerid][LoggedIn] == 1) {
        if(PlayerInfo[playerid][Level] >= 4) {
          new tmp[256], Index;      tmp = strtok(params,Index);
          if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /unbanname [name]");
            new adminname[MAX_PLAYER_NAME], string[128], unbanname;
            unbanname = strval(tmp);

                if(udb_Exists(unbanname))   {
                dUserSetINT(unbanname).("banned", 0);
                GetPlayerName(playerid, adminname, sizeof(adminname));
                CMDMessageToAdmins(playerid,"UNBANNAME");
                format(string,sizeof(string),"Server: %s has been unbanned by %s (ID: %d).",unbanname,adminname,playerid);
                SendClientMessageToAll(green,string);
                SaveToFile("UnBanLog",string);
                print(string);
                return 1;
            } else return SendClientMessage(playerid, red, "ERROR: No player with this name.");
        } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
    } else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
Hope anyone can help me.
Reply
#7

Quote:
Originally Posted by Jeffry
Lol, sorry, cant answer this, but here is the command.

pawn Код:
dcmd_unbanname(playerid,params[]) {
    if(PlayerInfo[playerid][LoggedIn] == 1) {
        if(PlayerInfo[playerid][Level] >= 4) {
          new tmp[256], Index;      tmp = strtok(params,Index);
          if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /unbanname [name]");
            new adminname[MAX_PLAYER_NAME], string[128], unbanname;
            unbanname = strval(tmp);

                if(udb_Exists(unbanname))   {
                dUserSetINT(unbanname).("banned", 0);
                GetPlayerName(playerid, adminname, sizeof(adminname));
                CMDMessageToAdmins(playerid,"UNBANNAME");
                format(string,sizeof(string),"Server: %s has been unbanned by %s (ID: %d).",unbanname,adminname,playerid);
                SendClientMessageToAll(green,string);
                SaveToFile("UnBanLog",string);
                print(string);
                return 1;
            } else return SendClientMessage(playerid, red, "ERROR: No player with this name.");
        } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
    } else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
Hope anyone can help me.
Did you tried what i said?
Reply
#8

Removing the strval?
Reply
#9

Quote:
Originally Posted by Jeffry
Removing the strval?
Yes

pawn Код:
dcmd_unbanname(playerid,params[]) {
if(PlayerInfo[playerid][LoggedIn] == 1) {
if(PlayerInfo[playerid][Level] >= 4) {
  new tmp[256], Index;   tmp = strtok(params,Index);
  if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /unbanname [name]");
new adminname[MAX_PLAYER_NAME], string[128], unbanname[MAX_PLAYER_NAME];
unbanname = tmp;

if(udb_Exists(unbanname))   {
dUserSetINT(unbanname).("banned", 0);
GetPlayerName(playerid, adminname, sizeof(adminname));
CMDMessageToAdmins(playerid,"UNBANNAME");
format(string,sizeof(string),"Server: %s has been unbanned by %s (ID: %d).",unbanname,adminname,playerid);
SendClientMessageToAll(green,string);
SaveToFile("UnBanLog",string);
print(string);
return 1;
} else return SendClientMessage(playerid, red, "ERROR: No player with this name.");
} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
} else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
Reply
#10

Wohoooooooo!! Thank you so much!!!
It works!!!!

Thank you!!!!!!!!
Reply
#11

Quote:
Originally Posted by Jeffry
Wohoooooooo!! Thank you so much!!!
It works!!!!

Thank you!!!!!!!!
Nice =D
Reply
#12

Quote:
Originally Posted by wafffllesss
Quote:
Originally Posted by Jeffry
Wohoooooooo!! Thank you so much!!!
It works!!!!

Thank you!!!!!!!!
Nice =D
helped me to make a /banname && /unbanname.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)