oi_read - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: oi_read (
/showthread.php?tid=81750)
oi_read -
Mr_C30 - 13.06.2009
salvation;
Can you help me get to code in yrace? I think that only the user yrace can help!
infact its not change the variable in my fs
Код:
public LoadRace(tmp[])
{
new string[256];
new race_name[50];
format(race_name, sizeof(race_name), "%s.type", tmp);
new File:gfile = fopen(race_name, io_read);
fread(gfile, string, model = strval(string));
model = string[100];
fclose(gfile);
if(model == 0)
{
format(ystring,128,"[INFO]: une course a pied se prйpare!");
return 1;
}
else if(model == 1)
{
format(ystring,128,"[INFO]: une course de voiture se prйpare!");
return 1;
}
else if(model == 2)
{
format(ystring,128,"[INFO]: une course de moto se prйpare!");
return 1;
}
SendClientMessageToAll(COLOR_YELLOW,ystring);
thx
Re: oi_read -
HuRRiCaNe - 13.06.2009
i did not undestand what your problem was
Re: oi_read -
Mr_C30 - 13.06.2009
My problem is that the variable model stays on 0

and thus sends the same message: s
Can you try to meter in yrace? pleaase
Re: oi_read -
63Sylvain - 29.06.2009
Код:
public LoadRace(tmp[])
{
new string[256];
new race_name[50];
format(race_name, sizeof(race_name), "%s.type", tmp);
new File:gfile;
gfile = fopen(race_name, io_read);
fread(gfile, string, sizeof(string));
fclose(gfile);
if(strfind(string, "0", true) == 0)
{
format(ystring,128,"[INFO]: une course a pied se prйpare!");
}
else if(strfind(string, "1", true) == 0)
{
format(ystring,128,"[INFO]: une course de voiture se prйpare!");
}
else if(strfind(string, "2", true) == 0)
{
format(ystring,128,"[INFO]: une course de moto se prйpare!");
}
SendClientMessageToAll(COLOR_YELLOW,ystring);
return 1;
}