[Help] ZCMD commands...
#1

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??
Reply
#2

Have you included zcmd?
Reply
#3

Yeah
Reply
#4

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

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

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

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
Reply
#7

Show us the code before that command.
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)