SA-MP Forums Archive
dini_Create on OnGameModeInit ? - 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: dini_Create on OnGameModeInit ? (/showthread.php?tid=157472)



dini_Create on OnGameModeInit ? - Miikkel - 06.07.2010

I'm currently creating a dynamic spawn for New Players, but I can't seem to get it to work.

I want it to check if there is a file called "NewbieSpawn.ini" in a folder called "ServerS" when the Gamemode starts up, if there ain't it creates a default Newbie Spawn.
But it simple won't create the file, and store the data in it, when I try to launch the server.

Under OnGameModeInit ...

pawn Код:
format(File, sizeof(File), "RLRPFiles/ServerS/NewbieSpawn.ini");
if(dini_Exists(File))
{
    nSpawn[X] = dini_Float(File, "X");
    nSpawn[Y] = dini_Float(File, "Y");
    nSpawn[Z] = dini_Float(File, "Z");
    nSpawn[Angle] = dini_Float(File, "Angle");
}
else
{
    dini_Create(File);
    dini_FloatSet(File, "X", 1642.0287);
    dini_FloatSet(File, "Y", -2333.9985);
    dini_FloatSet(File, "Z", 13.5469);
    dini_FloatSet(File, "Angle", 359.3964);
}
Thanks to everyone who helps me!

Edit: Problem Solved.