What kind of errors are these?
#1

pawn Код:
dcmd_changepass(playerid, params[])
    {
    new file[256], tmp[256], tmp2[256];
    new Index; tmp = strtok(params,Index); tmp2 = strtok(params,Index);
    GetPlayerName(playerid, pname, sizeof(pname));
    format(file, sizeof(file), "System/Users/%s.sav", pname);
    if(!strlen(tmp)){
      if(Options[Language]==1)SendClientMessage(playerid, COLOR_RED, "UTILIZZA /changepass [vecchia password] [nuova password]");else
      if(Options[Language]==2)SendClientMessage(playerid, COLOR_RED, "USAGE /changepass [old password] [new password]");
      return 0;}
    if(!strlen(tmp2)){
      if(Options[Language]==1)SendClientMessage(playerid, COLOR_RED, "UTILIZZA /changepass [vecchia password] [nuova password]");else
      if(Options[Language]==2)SendClientMessage(playerid, COLOR_RED, "USAGE /changepass [old password] [new password]");
      return 0;}
    if(!dini_Exists(file)){
      if(Options[Language]==1)SendClientMessage(playerid, COLOR_RED, "Non sei registrato!");else
      if(Options[Language]==2)SendClientMessage(playerid, COLOR_RED, "You are not registered!");
      return 0;}
    if(Account[playerid][pLoggedin]!=1){
      if(Options[Language]==1)SendClientMessage(playerid, COLOR_RED, "Prima di cambiare password devi accedere!!! (/login [password])");else
      if(Options[Language]==2)SendClientMessage(playerid, COLOR_RED, "Before changing password you must login!!!");
      return 0;}
    new tmp3[256]; tmp3 = dini_Get(file, "hashPW");
    if(udb_hash(tmp) != strval(tmp3)){
        if(Options[Language]==1)format(str, 256, "Hai sbagliato password %s!", pname),SendClientMessage(playerid, COLOR_RED, str);else
        if(Options[Language]==2)format(str, 256, "You wrote wrong password, %s!", pname),SendClientMessage(playerid, COLOR_RED, str);}else{
          PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
          dini_IntSet(file, "hashPW", udb_hash(tmp2));
          dini_Set(file, "password", tmp2);
          if(Options[Language]==1)format(str, 256, "Hai cambiato password con successo [nickname: %s][Nuova password: %s]", pname, tmp2),SendClientMessage(playerid, COLOR_LIGHTGREEN, str);else
          if(Options[Language]==2)format(str, 256, "You succesfully changed your password [nickname: %s][New password: %s]", pname, tmp2),SendClientMessage(playerid, COLOR_LIGHTGREEN, str);
          printf("%s (%i) logged in with password %s", pname, playerid, params);}
    return 1;

    }

Errors:
Код:
C:\Users\Barbara\Desktop\SAMP Kevin\hoi\gamemodes\SumoGM.pwn(1070) : error 017: undefined symbol "strtok"
C:\Users\Barbara\Desktop\SAMP Kevin\hoi\gamemodes\SumoGM.pwn(1070) : error 033: array must be indexed (variable "tmp")
C:\Users\Barbara\Desktop\SAMP Kevin\hoi\gamemodes\SumoGM.pwn(1070) : error 017: undefined symbol "strtok"
C:\Users\Barbara\Desktop\SAMP Kevin\hoi\gamemodes\SumoGM.pwn(1070) : fatal error 107: too many error messages on one line
What's wrong with the code?
Reply
#2

https://sampwiki.blast.hk/wiki/Strtok
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)