Need help with Dini - 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: Need help with Dini (
/showthread.php?tid=254384)
Need help with Dini -
marrcko - 10.05.2011
Hi, My GM crash everytime i use this:
pawn Код:
CMD:gaujospav(playerid, params[])
{
if(gplayerDB[playerid][glead]>0)
{
new gauja[56];
if( sscanf( params, "s[128]", gauja))
return SendClientMessage( playerid, ZALSVA, ">> pervadinti gauja: /gaujospav [pavadinimas]");
new msg[128];
strmid(gangDB[gplayerDB[playerid][glead]][gvardas],gauja,0,128,128);
GetPlayerPos(playerid,gangDB[playerid][bustine][0],gangDB[playerid][bustine][1],gangDB[playerid][bustine][2]);
format(msg,sizeof(msg),"Gaujos pavadinimas: \"%s\". Beto jusu bustine dabar yra cia.",gauja);
SendClientMessage(playerid,MELSVA,msg);
SAVEGAUJA(playerid);
}
return 1;
}
pawn Код:
stock SAVEGAUJA(playerid)
{
new gfile[128];
format(gfile,sizeof(gfile),"saves/gangs/%s",gplayerDB[playerid][glead]);
dini_Create(gfile);
dini_IntSet(gfile,"GangId",gplayerDB[playerid][glead]);
dini_IntSet(gfile,"GangName",gangDB[gplayerDB[playerid][glead]][gvardas]);
}
stock LOADGAUJA()
{
new idg;
for(new gid=0; gid<MAX_GANGS; gid)
{
format(file,sizeof(file),"saves/gangs/%i",gid);
if(!fexist(file))
{
}
idg=dini_Int(file,"GangId");
strmid(gangDB[idg][gvardas],dini_Get(file,"GangName"),0,128,128);
printf("Gaujos ID: %i; pavadinimas: %s",id,gangDB[idg][gvardas]);
}
}
So how fix it?
Re: Need help with Dini -
Daddy Yankee - 11.05.2011
Do you have writing permissions on those files ?
Re: Need help with Dini -
(SF)Noobanatior - 11.05.2011
and have you make them folders in your scriptfiles folder?
Re: Need help with Dini -
marrcko - 11.05.2011
LOL!! it has fixed it self samehow...LMAO!!!