SA-MP Forums Archive
[Help] ZCMD commands... - 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: [Help] ZCMD commands... (/showthread.php?tid=178655)



[Help] ZCMD commands... - Alex_Valde - 23.09.2010

I got this code...

pawn Код:
COMMAND:register(playerid, params[]) //<--------- This is the line 29896
    {
      new file[128], pname[MAX_PLAYER_NAME];
      GetPlayerName(playerid, pname, sizeof(pname));
      format(file, sizeof(file), "S_Files", pname);
      if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "[SYSTEM]: /register [password]");
      if(dini_Exists(file)) return SendClientMessage(playerid, COLOR_RED, "[SYSTEM]: You are already registered!");
      dini_Create(file);
          ....
          ....
and i get 4 errors....

Код:
C:\Users\CrTheVirus\Desktop\Samp Server\[SAMP 0.3] - Razer\gamemodes\razer.pwn(29896) : error 029: invalid expression, assumed zero
C:\Users\CrTheVirus\Desktop\Samp Server\[SAMP 0.3] - Razer\gamemodes\razer.pwn(29896) : error 017: undefined symbol "cmd_register"
C:\Users\CrTheVirus\Desktop\Samp Server\[SAMP 0.3] - Razer\gamemodes\razer.pwn(29896) : error 029: invalid expression, assumed zero
C:\Users\CrTheVirus\Desktop\Samp Server\[SAMP 0.3] - Razer\gamemodes\razer.pwn(29896) : fatal error 107: too many error messages on one line
Any help??


Re: [Help] ZCMD commands... - LarzI - 23.09.2010

Have you included zcmd?


Re: [Help] ZCMD commands... - Alex_Valde - 23.09.2010

Yeah


Re: [Help] ZCMD commands... - Retardedwolf - 23.09.2010

Make sure the braces are put correctly. and theres a return at the end of the command.


Re: [Help] ZCMD commands... - PixeledNinja - 23.09.2010

Did you put in inside of public OnPlayerCommandText(playerid, cmdtext[])?

If so, move it to the bottom of the script, outside of any callbacks.



Re: [Help] ZCMD commands... - Alex_Valde - 23.09.2010

This is my whole code...
Код:
 COMMAND:register(playerid, params[])
    {
      new file[128], pname[MAX_PLAYER_NAME];
      GetPlayerName(playerid, pname, sizeof(pname));
      format(file, sizeof(file), "S_Files", pname);
      if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "[SYSTEM]: /register [password]");
      if(dini_Exists(file)) return SendClientMessage(playerid, COLOR_RED, "[SYSTEM]: You are already registered!");
      dini_Create(file);
      dini_IntSet(file, "hashPW", udb_hash(params));
      dini_Set(file, "password", params);
      dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][AdminLevel] = 0);
      dini_IntSet(file, "score", PlayerInfo[playerid][score] = 0);
      dini_IntSet(file, "money", PlayerInfo[playerid][cash] = 500);
      new string[128];
      format(string, 128, "[SYSTEM]: You succesfully registered the nickname %s with password %s", pname, params);
      SendClientMessage(playerid, COLOR_YELLOW, string);
      logged[playerid] = 1;
      SendClientMessage(playerid, COLOR_YELLOW, "[SYSTEM]: You have been automatically logged in!");
      return 1;
    }
I have return and all.... :S


Re: [Help] ZCMD commands... - LarzI - 23.09.2010

Show us the code before that command.


Re: [Help] ZCMD commands... - Alex_Valde - 23.09.2010

I solved it it was on my OnPlayerCommandText(playerid, cmdtext[]) Callback...
:S
Thanks everyone and
Thanks PixeledNinja!