It doesnt Change the File line [Still needing help]
#1

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!
Reply
#2

Modified question!
Reply
#3

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
Reply
#4

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 @@!
Reply
#5

help please?
Reply
#6

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

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

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 :-/
Reply
#9

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

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 :-/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)