WTF? check...
#1

guys what is wrong here ?

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  new name[MAX_PLAYER_NAME];
  GetPlayerName(playerid, name, sizeof(name));
	new file[256];
	new tmp[256];
	new tmp2[256];
 	
 	if(dialogid == 1) // Register Dialog
 	{
		format(file,sizeof(file),"/KA/Users/%s.sav",udb_encode(name));
  	if(!fexist(file))
  	{
  	dini_Create(file);
  	dini_IntSet(file, "Password", udb_hash(tmp));
  	dini_IntSet(file,"AdminLevel", 0);
  	dini_IntSet(file,"Cash", 500);
  	dini_IntSet(file,"Registered", 1);
  	SendClientMessage(playerid, COLOR_GREEN, "[System]: Account Created!");
  	PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
  	GetPlayerName(playerid, name, sizeof(name));
  	printf("%s has registered a account!", name);
  	}
  	else
		{
		SendClientMessage(playerid, COLOR_GREEN, " Account Already Found In Database");
		PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
		return 1;
		}
	}
  if(dialogid == 2) // Login Dialog
	{
		if(IsLogged[playerid] == 1)
		{
			SendClientMessage(playerid, COLOR_GREEN, "You already are logged in!");
			return 1;
		}
		else
		{
			format(file,sizeof(file),"/KA/Users/%s.sav",udb_encode(name(playerid)) ); --------------------------------> Error line
			if(fexist(file))
			{
			tmp2 = dini_Get(file, "Password");
			if(udb_hash(tmp) != strval(tmp2))
			{
			SendClientMessage(playerid, COLOR_GREEN, "Login Failed!");
  			GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
		  printf("%s has failed to login", name);
		  }
		  else
		  {
		  IsLogged[playerid] = 1;
	 		SetPlayerMoney(playerid, dini_Int(file, "Cash"));
			PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
			PlayerInfo[playerid][Registered] = dini_Int(file, "Registered");
			SendClientMessage(playerid, COLOR_GREEN, "[System]: Account Logged into!");
			}
			return 1;
		}
	}
	}
	return 1;
}
and this errorS

Код:
C:\Documents and Settings\samp\Desktop\Server 2\gamemodes\new.pwn(377) : error 012: invalid function call, not a valid address
C:\Documents and Settings\samp\Desktop\Server 2\gamemodes\new.pwn(377) : warning 215: expression has no effect
C:\Documents and Settings\samp\Desktop\Server 2\gamemodes\new.pwn(377) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\samp\Desktop\Server 2\gamemodes\new.pwn(377) : error 029: invalid expression, assumed zero
C:\Documents and Settings\samp\Desktop\Server 2\gamemodes\new.pwn(377) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

What is Line 377?? Post please and I'll take a look.
Reply
#3

next time look what i post and roll down a bit and u will see ''-----------------------> Error Line'' but nvm

Код:
format(file,sizeof(file),"/KA/Users/%s.sav",udb_encode(name(playerid)) ); --------------------------------> Error line
Reply
#4

Quote:
Originally Posted by Lajko1
next time look what i post and roll down a bit and u will see ''-----------------------> Error Line'' but nvm

Код:
format(file,sizeof(file),"/KA/Users/%s.sav",udb_encode(name(playerid)) ); --------------------------------> Error line
is name a function, or a messed up array ?
Reply
#5

ok i change this file but still same errors on same line ...
Reply
#6

anyone?
Reply
#7

Quote:
Originally Posted by Lajko1
anyone?
read my post ?
Reply
#8

i do but actually i understand it what do you want to ask me ... u have posted all up there ...
i really don't understand what u want to ask

ty for help
Reply
#9

Quote:
Originally Posted by Lajko1
i do but actually i understand it what do you want to ask me ... u have posted all up there ...
i really don't understand what u want to ask

ty for help
you have name(playerid) ... change it to name[playerid]
Reply
#10

thanks it works, can u just explain ? what was wrong i mean about those function or array?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)