SA-MP Forums Archive
It doesnt Change the File line [Still needing help] - 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: It doesnt Change the File line [Still needing help] (/showthread.php?tid=125014)



It doesnt Change the File line [Still needing help] - patchkinson - 01.02.2010

Hey, this script is supposed to save the admin level i set, to the player file, in /admin/users/%s.ini but it doesnt, it sets admin, but doesnt save the AdminLevel, !
i have this too btw:
new IsLogged[MAX_PLAYERS];
enum pInfo
{
AdminLevel,
Cash,

}
new PlayerInfo[MAX_PLAYERS][pInfo];
here is the script
if(!strcmp(cmdtext[1],"makeadmin",true,9))
{
new name[MAX_PLAYER_NAME];
new adminstring[5];
new tmpstring[128];
if(PlayerInfo[playerid][AdminLevel]<5) return SendClientMessage(playerid,0xFF0000FF,"You're not authorized to use that command");
new tmpspace = strfind(cmdtext," ",true,11);
if(!cmdtext[11])return SendClientMessage(playerid,0xFF0000FF,"USAGE: /MakeAdmin <playerid> <admin level>");
if(!cmdtext[tmpspace+1])return SendClientMessage(playerid,0xFF0000FF,"USAGE: /MakeAdmin <playerid> <admin level>");
PlayerInfo[strval(cmdtext[11])][AdminLevel]=strval(cmdtext[tmpspace+1]);
format(adminstring,sizeof(adminstring),"&d",strval (cmdtext[tmpspace+1]));
GetPlayerName(strval(cmdtext[11]),tmpstring,MAX_PLAYER_NAME);
format(tmpstring,128,"You made %s AdminLevel %d",tmpstring,strval(cmdtext[tmpspace+1]));
SendClientMessage(playerid,0xFFFFFFFF,tmpstring);
format(file,sizeof(file),"/admin/users/%s.ini",name);
dini_Set(file,"AdminLevel",adminstring);
GetPlayerName(playerid,tmpstring,MAX_PLAYER_NAME);
format(tmpstring,128,"%s made you AdminLevel %d",tmpstring,strval(cmdtext[tmpspace+1]));
return SendClientMessage(strval(cmdtext[11]),0xFFFFFFFF,tmpstring);
}
thanks in advance!


Re: undefined symbol! - patchkinson - 01.02.2010

Modified question!


Re: arguement type mismatch! - Eazy_Efolife - 01.02.2010

Quote:
Originally Posted by patchkinson
Hey, i get error, argument type mismatch argument 3 on line : dini_IntSet(file,"AdminLevel", adminstring);
here is the script
if(!strcmp(cmdtext[1],"makeadmin",true,9))
{
new name[MAX_PLAYER_NAME];
new adminstring[5];
new tmpstring[128];
if(PlayerInfo[playerid][AdminLevel]<5) return SendClientMessage(playerid,0xFF0000FF,"You're not authorized to use that command");
new tmpspace = strfind(cmdtext," ",true,11);
if(!cmdtext[11])return SendClientMessage(playerid,0xFF0000FF,"USAGE: /MakeAdmin <playerid> <admin level>");
if(!cmdtext[tmpspace+1])return SendClientMessage(playerid,0xFF0000FF,"USAGE: /MakeAdmin <playerid> <admin level>");
PlayerInfo[strval(cmdtext[11])][AdminLevel]=strval(cmdtext[tmpspace+1]);
format(adminstring,sizeof(adminstring),"$d",strval (cmdtext[tmpspace+1]));
GetPlayerName(strval(cmdtext[11]),tmpstring,MAX_PLAYER_NAME);
format(tmpstring,128,"You made %s AdminLevel %d",tmpstring,strval(cmdtext[tmpspace+1]));
SendClientMessage(playerid,0xFFFFFFFF,tmpstring);
format(file,sizeof(file),"/admin/users/%s.ini",name);
dini_IntSet(file,"AdminLevel",adminstring);
GetPlayerName(playerid,tmpstring,MAX_PLAYER_NAME);
format(tmpstring,128,"%s made you AdminLevel %d",tmpstring,strval(cmdtext[tmpspace+1]));
return SendClientMessage(strval(cmdtext[11]),0xFFFFFFFF,tmpstring);
}
thanks in advance!
Use ..

And Dini_IntSet is only used for integers. Replace Dini_IntSet with Dini_Set



Re: arguement type mismatch! - patchkinson - 01.02.2010

Quote:
Originally Posted by Compton's Eazy E
Quote:
Originally Posted by patchkinson
Hey, i get error, argument type mismatch argument 3 on line : dini_IntSet(file,"AdminLevel", adminstring);
here is the script
if(!strcmp(cmdtext[1],"makeadmin",true,9))
{
new name[MAX_PLAYER_NAME];
new adminstring[5];
new tmpstring[128];
if(PlayerInfo[playerid][AdminLevel]<5) return SendClientMessage(playerid,0xFF0000FF,"You're not authorized to use that command");
new tmpspace = strfind(cmdtext," ",true,11);
if(!cmdtext[11])return SendClientMessage(playerid,0xFF0000FF,"USAGE: /MakeAdmin <playerid> <admin level>");
if(!cmdtext[tmpspace+1])return SendClientMessage(playerid,0xFF0000FF,"USAGE: /MakeAdmin <playerid> <admin level>");
PlayerInfo[strval(cmdtext[11])][AdminLevel]=strval(cmdtext[tmpspace+1]);
format(adminstring,sizeof(adminstring),"$d",strval (cmdtext[tmpspace+1]));
GetPlayerName(strval(cmdtext[11]),tmpstring,MAX_PLAYER_NAME);
format(tmpstring,128,"You made %s AdminLevel %d",tmpstring,strval(cmdtext[tmpspace+1]));
SendClientMessage(playerid,0xFFFFFFFF,tmpstring);
format(file,sizeof(file),"/admin/users/%s.ini",name);
dini_IntSet(file,"AdminLevel",adminstring);
GetPlayerName(playerid,tmpstring,MAX_PLAYER_NAME);
format(tmpstring,128,"%s made you AdminLevel %d",tmpstring,strval(cmdtext[tmpspace+1]));
return SendClientMessage(strval(cmdtext[11]),0xFFFFFFFF,tmpstring);
}
thanks in advance!
Use ..

And Dini_IntSet is only used for integers. Replace Dini_IntSet with Dini_Set
ok it was nice of you to help, the warning or error disappeared, but it still doesnt save to the file. can anyone help me?, cause it doesnt save the admin level to the file yet @@!


Re: It doesnt Change the File line [Unsolved] - patchkinson - 02.02.2010

help please?


Re: It doesnt Change the File line [Unsolved] - dice7 - 02.02.2010

Do the path or the file actually exist ?
And does the code execute all the way ?


Re: It doesnt Change the File line [Unsolved] - patchkinson - 02.02.2010

Quote:
Originally Posted by dice7
Do the path or the file actually exist ?
And does the code execute all the way ?
yes & yes


Re: It doesnt Change the File line [Still needing help] - patchkinson - 04.02.2010

Sorry foor bump again but i think 12 hours have been aand i think i can bump 12 hours after, i really need help ya see :-/


Re: It doesnt Change the File line [Still needing help] - notime - 04.02.2010

Remove:
Код:
format(adminstring,sizeof(adminstring),"$d",strval(cmdtext[tmpspace+1]));
and use this:
Код:
dini_IntSet(file,"AdminLevel",strval(cmdtext[tmpspace+1]));



Re: It doesnt Change the File line [Still needing help] - patchkinson - 04.02.2010

Quote:
Originally Posted by Notime
Remove:
Код:
format(adminstring,sizeof(adminstring),"$d",strval(cmdtext[tmpspace+1]));
and use this:
Код:
dini_IntSet(file,"AdminLevel",strval(cmdtext[tmpspace+1]));
thanks, will try this weekend :-/