SA-MP Forums Archive
Strtok 1 error... - 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: Strtok 1 error... (/showthread.php?tid=67277)



Strtok 1 error... - introzen - 28.02.2009

Okey i bet this is the most easiest thing to solve.. but i don't know how xD

pawn Код:
if(strcmp(cmd,"/register",true) == 0)
    {
      new tmp[128],string[256],pName[MAX_PLAYER_NAME];
      GetPlayerName(playerid,pName,sizeof(pName));
      format(string,sizeof(string),"EQRP//Players//%s.ini",pName);
      tmp = strtok(cmdtext, idx);
        new password = strval(tmp);
      if(PlayerInfo[playerid][pRegged] == 1) return SendClientMessage(playerid,COLOR_DARKRED,"Already Registered");
      if(strlen(tmp) == 0) return SendClientMessage(playerid,COLOR_DARKRED,"USAGE: /register [password]");
        PlayerInfo[playerid][pRegged] = 1;
        dini_Create(string);
        dini_Set(string,"Password",password); // line 867
        dini_IntSet(string,"Money",20000);
        dini_IntSet(string,"Bank",50000);
        dini_IntSet(string,"DriverLic",0);
        dini_IntSet(string,"WeaponLic",0);
        SetPlayerSkin(playerid,188);
        SpawnPlayer(playerid);
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"Succesfully Registered, now login: /login [password]");
        return 1;
    }
and this error:

Код:
C:\Documents and Settings\HP_Дgaren\Skrivbord\SAMP\samp server\gamemodes\EQRP.pwn(867) : error 035: argument type mismatch (argument 3)



Re: Strtok 1 error... - RyDeR` - 28.02.2009

What Code = 867 ?


Re: Strtok 1 error... - introzen - 28.02.2009

Quote:
Originally Posted by ToD
What Code = 867 ?
It's marked lol.... // line 867 in the code


Re: Strtok 1 error... - RyDeR` - 28.02.2009

Quote:
Originally Posted by ToD
What Code = 867 ?
hehe
Replace this whith yours
Код:
if(strcmp(cmd,"/register",true) == 0)
{
  new tmp[128],string[256],pName[MAX_PLAYER_NAME];
  GetPlayerName(playerid,pName,sizeof(pName));
  format(string,sizeof(string),"EQRP/Players/%s.ini",pName);
  tmp = strtok(cmdtext, idx);
new password = strval(tmp);
  if(PlayerInfo[playerid][pRegged] == 1) return SendClientMessage(playerid,COLOR_DARKRED,"Already Registered");
  if(strlen(tmp) == 0) return SendClientMessage(playerid,COLOR_DARKRED,"USAGE: /register [password]");
PlayerInfo[playerid][pRegged] = 1;
dini_Create(string);
dini_Set(string,"Password",password);  // line 867
dini_IntSet(string,"Money",20000);
dini_IntSet(string,"Bank",50000);
dini_IntSet(string,"DriverLic",0);
dini_IntSet(string,"WeaponLic",0);
SetPlayerSkin(playerid,188);
SpawnPlayer(playerid);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Succesfully Registered, now login: /login [password]");
return 1;
}



Re: Strtok 1 error... - RyDeR` - 28.02.2009




Re: Strtok 1 error... - MenaceX^ - 28.02.2009

pawn Код:
format(string,sizeof(string),"EQRP//Players//%s.ini",pName);
You canceled the finish.


Re: Strtok 1 error... - introzen - 28.02.2009

Still same error...


Re: Strtok 1 error... - RyDeR` - 28.02.2009

Did you try this?
Код:
if(strcmp(cmd,"/register",true) == 0)
{
  new tmp[128],string[256],pName[MAX_PLAYER_NAME];
  GetPlayerName(playerid,pName,sizeof(pName));
  format(string,sizeof(string),"/EQRP/Players/%s.ini",pName);
  tmp = strtok(cmdtext, idx);
new password = strval(tmp);
  if(PlayerInfo[playerid][pRegged] == 1) return SendClientMessage(playerid,COLOR_DARKRED,"Already Registered");
  if(strlen(tmp) == 0) return SendClientMessage(playerid,COLOR_DARKRED,"USAGE: /register [password]");
PlayerInfo[playerid][pRegged] = 1;
dini_Create(string);
dini_Set(string,"Password",password); // line 867
dini_IntSet(string,"Money",20000);
dini_IntSet(string,"Bank",50000);
dini_IntSet(string,"DriverLic",0);
dini_IntSet(string,"WeaponLic",0);
SetPlayerSkin(playerid,188);
SpawnPlayer(playerid);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Succesfully Registered, now login: /login [password]");
return 1;
}



Re: Strtok 1 error... - introzen - 28.02.2009

Quote:
Originally Posted by ToD
Did you try this?
Код:
if(strcmp(cmd,"/register",true) == 0)
{
  new tmp[128],string[256],pName[MAX_PLAYER_NAME];
  GetPlayerName(playerid,pName,sizeof(pName));
  format(string,sizeof(string),"EQRP/Players/%s.ini",pName);
  tmp = strtok(cmdtext, idx);
new password = strval(tmp);
  if(PlayerInfo[playerid][pRegged] == 1) return SendClientMessage(playerid,COLOR_DARKRED,"Already Registered");
  if(strlen(tmp) == 0) return SendClientMessage(playerid,COLOR_DARKRED,"USAGE: /register [password]");
PlayerInfo[playerid][pRegged] = 1;
dini_Create(string);
dini_Set(string,"Password",password); // line 867
dini_IntSet(string,"Money",20000);
dini_IntSet(string,"Bank",50000);
dini_IntSet(string,"DriverLic",0);
dini_IntSet(string,"WeaponLic",0);
SetPlayerSkin(playerid,188);
SpawnPlayer(playerid);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Succesfully Registered, now login: /login [password]");
return 1;
}
yes, nothing changed


Re: Strtok 1 error... - introzen - 28.02.2009

pawn Код:
dini_Set(string,"Password",password);  // line 867
that line has error, 3rd argument