need help scripting.... login cmd - 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)
+--- Thread: need help scripting.... login cmd (
/showthread.php?tid=387090)
need help scripting.... login cmd -
irfu - 23.10.2012
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
COMMAND:login(playerid, params[])
{
if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,-4,"You are already logged in!");
new password[23],password2[23];
if(sscanf(params,"s[23]",password)) return SendClientMessage(playerid,-1,"USAGE: /login <password>");
new file[64],PlayerName[24];
GetPlayerName(playerid,PlayerName,sizeof PlayerName);
format(file,sizeof file,"Admin/%s.ini",PlayerName);
if(!fexist(file)) return SendClientMessage(playerid,-4,"Please use /register");
INI_Open(file);
INI_ReadString(password2,"Password");
if(strcmp(password,password2) != 0) return SendClientMessage(playerid,-4,"Wrong password!"),INI_Close();
PInfo[playerid][Level] = INI_ReadInt("Level");
INI_Close();
SendClientMessage(playerid,-1,"You have been successfully logged in!");
PInfo[playerid][Logged] = 1;
return 1;
}
In this the second line i have many errors...
error 029: invalid expression, assumed zero
error 017: undefined symbol "cmd_login"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
can anyone help me pls....
Re : need help scripting.... login cmd -
KryptosGuy - 23.10.2012
ZCMD's command don't have to be in "OnPlayerCommandText" callback. Move it out.
Re: need help scripting.... login cmd -
irfu - 23.10.2012
ok tnx buddy!
Re : need help scripting.... login cmd -
KryptosGuy - 23.10.2012
Problem solved ?