SA-MP Forums Archive
Need Help !! 3_errors in my script - 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 !! 3_errors in my script (/showthread.php?tid=449666)



Need Help !! 3_errors in my script - ViperZ - 09.07.2013

HI all
I am working on making my own FS System Register/Login
And i have this ERRORS:

Quote:

F:\Kimo\Scripts\MON_SERVEUR\TDM-SERVER\Enregistration.pwn(8 : error 001: expected token: ";", but found "-identifier-"
F:\Kimo\Scripts\MON_SERVEUR\TDM-SERVER\Enregistration.pwn(89) : error 017: undefined symbol "ioread"
F:\Kimo\Scripts\MON_SERVEUR\TDM-SERVER\Enregistration.pwn(83) : warning 203: symbol is never used: "playerid"
F:\Kimo\Scripts\MON_SERVEUR\TDM-SERVER\Enregistration.pwn(102) : error 001: expected token: ";", but found "-identifier-"

-My Scripts:
Quote:

public OnPlayerConnect(playerid)
{
new string[256],name[MAX_PLAYER_NAME];
format(string,256,"Players/%s.ini",name);

if (fexist(string))
{
ShowPlayerDialog(playerid,80,DIALOG_STYLE_INPUT,"L OGIN","WELCOME ! PLEASE LOGIN IN!","LOGIN","EXIT");
}
else
{
ShowPlayerDialog(playerid,81,DIALOG_STYLE_INPUT,"R EGISTER","WELCOME ! PLEASE REGISTER!","REGISTER","EXIT");
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new i = 1;
switch(dialogid)
{
case 80:
{
if(response==1)
{
if(strcmp(ReadPlayer(i,playerid),inputtext,false)! =0)
{
SendClientMessage(playerid,0xFF0000FF,"Invalid Password!");
ShowPlayerDialog(playerid,80,DIALOG_STYLE_INPUT,"L OGIN","WELCOME ! PLEASE LOGIN IN!","LOGIN","EXIT");
}
else TogglePlayerSpectating(playerid,0);
}
else Kick(playerid);
}
case 81:
{
if(response==1)
{
WritePlayer(inputtext,playerid,true);
TogglePlayerSpectating(playerid,0);
}
else Kick(playerid);
}
}
return 1;
}
ReadPlayer(line,playerid)
{
new string[256],name[MAX_PLAYER_NAME];
new Filelayer
//GetPlayerName(playerid,name,sizeof(name));
format(string,256,"Players/%s.ini",name);
player = fopen(string, ioread);
for (new i=1; i<=line; i++)
{
fread(player,string);
if (line==i)
{fclose(player); return string;}
}
return string;
}
WritePlayer(text[],playerid, bool:filestart)
{
new string[256],name[MAX_PLAYER_NAME];
new Filelayer
GetPlayerName(playerid,name,sizeof(name));
format(string,256,"Players/%s.ini",name);
player = fopen(string, io_append);
if (filestart)
{
fwrite(player,text);
}
else
{
format(string,256,"\n%s",text);
fwrite(player,string);
}
fclose(player);
}

Pleas I need help !!!!

Sorry Iam bad English ^^


Re: Need Help !! 3_errors in my script - McBan - 09.07.2013

You need to add ; where necessary, also define ioread as a variable if it is one.


Re : Need Help !! 3_errors in my script - ViperZ - 09.07.2013

Quote:

format(string,256,"Players/%s.ini",name);
> error 001: expected token: ";", but found "-identifier-
"
Quote:

player = fopen(string, ioread);

> error 017: undefined symbol "ioread"

Quote:

GetPlayerName(playerid,name,sizeof(name));
>error 001: expected token: ";", but found "-identifier-"




AW: Need Help !! 3_errors in my script - roym899 - 09.07.2013

You forgot the ; in the line above the two lines you've quoted.
And it has to be io_read instead of ioread.


Re : Need Help !! 3_errors in my script - ViperZ - 09.07.2013

thank you very much
i have another problem ...
i have create the folder "Players" in folder "ScriptFiles" But when i create a account in my server...the folder "Players" is empty
thank you...
Help me pleas ^^


Re: Need Help !! 3_errors in my script - Champ - 09.07.2013

Check the registration path in the script.


AW: Re: Need Help !! 3_errors in my script - roym899 - 09.07.2013

Quote:
Originally Posted by Champ
Посмотреть сообщение
Check the registration path in the script.
You can actually see it in the part he posted there, but I think it's correct... atleast I haven't found the mistake yet.


Re : Need Help !! 3_errors in my script - ViperZ - 09.07.2013

Help ?