SA-MP Forums Archive
[SOLVED]2 Errors ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [SOLVED]2 Errors ? (/showthread.php?tid=130146)



[SOLVED]2 Errors ? - Jeffry - 25.02.2010

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.



Re: [Hmm]2 Errors ? - skynny - 25.02.2010

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


Re: [Hmm]2 Errors ? - Jeffry - 25.02.2010

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 )


Re: [Hmm]2 Errors ? - Jeffry - 26.02.2010

Anyone can help me?


Re: [Hmm]2 Errors ? - wafffllesss - 26.02.2010

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;



Re: [Hmm]2 Errors ? - Jeffry - 26.02.2010

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.


Re: [Hmm]2 Errors ? - wafffllesss - 26.02.2010

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?


Re: [Hmm]2 Errors ? - Jeffry - 26.02.2010

Removing the strval?


Re: [Hmm]2 Errors ? - wafffllesss - 26.02.2010

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");
}



Re: [Hmm]2 Errors ? - Jeffry - 26.02.2010

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

Thank you!!!!!!!!


Re: [Hmm]2 Errors ? - wafffllesss - 26.02.2010

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

Thank you!!!!!!!!
Nice =D


Re: [Hmm]2 Errors ? - Jeffry - 26.02.2010

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.