Again argument mismatch.
#1

So i'm trying to make register/login system in dialogs I'm trying to learn from my fails but i really don't know what i'm doing I'm using Djson
Код:
C:\Users\Machlik\Downloads\samp03bsvr_R2_win32\gamemodes\Untitled.pwn(149) : warning 215: expression has no effect
C:\Users\Machlik\Downloads\samp03bsvr_R2_win32\gamemodes\Untitled.pwn(150) : error 035: argument type mismatch (argument 3)
C:\Users\Machlik\Downloads\samp03bsvr_R2_win32\gamemodes\Untitled.pwn(154) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Код:
public OnPlayerConnect(playerid)
{
    new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
    PlayerInfo[playerid][pSelect] == 0;
 	if(!djIsSet("%s.json","player/name", name))
    {
		ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Register","Enter your password below:","Register","Cancel");
	}
	else if(djIsSet("%s.json","player/name", name))
	{
	    ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login","Enter your password below:","Login","Cancel");
	}
}
Reply
#2

PlayerInfo[playerid][pSelect] = 0;
Reply
#3

Quote:
Originally Posted by exora
Посмотреть сообщение
PlayerInfo[playerid][pSelect] = 0;
Still those arguments errors
Reply
#4

pawn Код:
if(!djIsSet("%s.json","player/name", name))
You need to create a string, format it (using format) and then use the string name in the djIsSet function.
Reply
#5

Tell me if i did it correct
Код:
    new name[MAX_PLAYER_NAME];
    new string[128];
    new file[128];
	GetPlayerName(playerid, name, sizeof(name));
    PlayerInfo[playerid][pSelect] == 0;
    format(file,sizeof(file),"%s.json","player/name",name);
 	if(!djIsSet(file))
    {
		ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Register","Enter your password below:","Register","Cancel");
	}
	else if(djIsSet(file))
	{
	    ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login","Enter your password below:","Login","Cancel");
	}
}
I'm gettin' only those warnings
Код:
C:\Users\Machlik\Downloads\samp03bsvr_R2_win32\gamemodes\Untitled.pwn(153) : warning 202: number of arguments does not match definition
C:\Users\Machlik\Downloads\samp03bsvr_R2_win32\gamemodes\Untitled.pwn(157) : warning 202: number of arguments does not match definition
C:\Users\Machlik\Downloads\samp03bsvr_R2_win32\gamemodes\Untitled.pwn(148) : warning 204: symbol is assigned a value that is never used: "string"
If it's good please give me a point how to make password save
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)