FAST Fast Help +Rep
#1

Help me to Fix This Plesae.

PHP код:
gamemodes\C_VS_T_4.1.pwn(1338) : error 017undefined symbol "strtok"
gamemodes\C_VS_T_4.1.pwn(1338) : error 033: array must be indexed (variable "tmp")
gamemodes\C_VS_T_4.1.pwn(1338) : error 017undefined symbol "strtok" 

Код:
dcmd_changepass(playerid, params[]){
    new file[256], tmp[256],tmp2[257], Index; tmp = strtok(params,Index); tmp2 = strtok(params, Index);
    GetPlayerName(playerid, pname, sizeof(pname));
    format(file, sizeof(file), "Users/%s.sav", pname);
    if(!strlen(tmp)){
	  if(ServerInfo[Language]==1)SendClientMessage(playerid, COLOR_RED, "UTILIZZA /changepass "#COL_RED"[vecchia password] [nuova password]");else
	  if(ServerInfo[Language]==2)SendClientMessage(playerid, COLOR_RED, "USAGE /changepass "#COL_RED"[old password] [new password]");
	  return 1;}
    if(!strlen(tmp2)){
	  if(ServerInfo[Language]==1)SendClientMessage(playerid, COLOR_RED, "UTILIZZA /changepass [vecchia password] "#COL_RED"[nuova password]");else
	  if(ServerInfo[Language]==2)SendClientMessage(playerid, COLOR_RED, "USAGE /changepass [old password] "#COL_RED"[new password]");
	  return 1;}
    if(!dini_Exists(file)){
	  if(ServerInfo[Language]==1)SendClientMessage(playerid, COLOR_RED, "Non sei registrato!");else
	  if(ServerInfo[Language]==2)SendClientMessage(playerid, COLOR_RED, "You are not registered!");
	  return 1;}
    if(Account[playerid][pLoggedin]!=1){
	  if(ServerInfo[Language]==1)SendClientMessage(playerid, COLOR_RED, "Prima di cambiare password devi accedere!!! (/login [password])");else
	  if(ServerInfo[Language]==2)SendClientMessage(playerid, COLOR_RED, "Before changing password you must login!!!");
	  return 1;}
    new tmp3[256]; tmp3 = dini_Get(file, "hashPW");
    if(udb_hash(tmp) != strval(tmp3)){
        if(ServerInfo[Language]==1)format(str, 256, "Hai sbagliato password %s!", pname),SendClientMessage(playerid, COLOR_RED, str);else
		if(ServerInfo[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(ServerInfo[Language]==1)format(str, 256, "Hai cambiato password con successo [nickname: %s][Nuova password: %s]", pname, tmp2),SendClientMessage(playerid, COLOR_LIGHTGREEN, str);else
		  if(ServerInfo[Language]==2)format(str, 256, "You succesfully changed your password [nickname: %s][New password: %s]", pname, tmp2),SendClientMessage(playerid, COLOR_LIGHTGREEN, str);
          printf("ACCOUNT: %s (%i) logged in with password %s", pname, playerid, params);}
    return 1;}
Reply
#2

BUMB?
Reply
#3

Have you defined strtok?

Код:
strtok(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++;
	}
 
	new offset = index;
	new result[20];
	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}
	result[index - offset] = EOS;
	return result;
}
https://sampwiki.blast.hk/wiki/Strtok
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)