SA-MP Forums Archive
Command don't work anymore - 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: Command don't work anymore (/showthread.php?tid=138537)



Command don't work anymore - sean5874 - 02.04.2010

Hey,
I have a login-register system created by someone else. I use it for a long time and i never had any trouble. But suddenly the /register command don't work any more. I haven't changed anything to this command, i only add some more commands to the script. Anyone know what could be the reason for this??
Greetz,
sean5874


Re: Command don't work anymore - Ragidon - 02.04.2010

We can't do anything if we don't see the script.


Re: Command don't work anymore - Mystique - 02.04.2010

What does it say?


Re: Command don't work anymore - sean5874 - 02.04.2010

Quote:

We can't do anything if we don't see the script.

Here you have the piece of script we're talking about:

Код:
if(strcmp(cmd, "/register", true) == 0)
  {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
      SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /register (password)");
    }
    else
    {
 			if (!dini_Exists(udb_encode(playername)))
     	{
       	dini_Create(udb_encode(playername));
        dini_IntSet(udb_encode(playername), "password", udb_hash(tmp));
        dini_IntSet(udb_encode(playername), "adminlevel", 0);
        dini_IntSet(udb_encode(playername), "money", 0);
        dini_IntSet(udb_encode(playername), "license", 1);
        dini_IntSet(udb_encode(playername), "health", 100);
        dini_IntSet(udb_encode(playername), "bankmoney", 100);
        dini_IntSet(udb_encode(playername), "fightstyle", 0);
        dini_IntSet(udb_encode(playername), "carlocks", 0);
        dini_IntSet(udb_encode(playername), "cigarets", 0);
        dini_IntSet(udb_encode(playername), "beer", 0);
        dini_IntSet(udb_encode(playername), "sprunk", 0);
        dini_IntSet(udb_encode(playername), "rope", 0);
        format(string, sizeof(string), "Account %s was created. You can now log in with the password: %s.", playername, tmp);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        TextDrawHideForPlayer(playerid, register);
        TextDrawShowForPlayer(playerid, login);
        return 1;
      }
      else
      {
        format(string, sizeof(string), "%s already registered.", playername,tmp);
        SendClientMessage(playerid, COLOR_RED, string);
      }
    }
    return 1;
  }
Quote:

Insert Quote
What does it say?

Thats the weirdest thing: it don't say unkown command or something, but it says nothing!


Re: Command don't work anymore - Mystique - 02.04.2010

I don't actually know but is the first return 1; really needed? I think you only need it at the end.