17.01.2015, 22:07
I made a police system it works and when the player disconnected and connected again it load his police level.
The problem that if the server losed and re-open it set the player levle to 0.
Here is some codes might help
Here is the save and under the command that make a police officer
Please Help !!
I am using Y_ini btw
The problem that if the server losed and re-open it set the player levle to 0.
Here is some codes might help
PHP код:
stock LoadLevel(name[],value[],playerid)
{
new file[60];
format(file,sizeof(file),"/police/%s.ini",playerid);
INI_Open(file);
return 1;
}
public OnPlayerConnect(playerid)
{
LoadLevel("Police",Playerinfo[playerid][pPolice],playerid);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Police",PlayerInfo[playerid][pPolice]);
INI_Close(File);
return 1;
}
PHP код:
PlayerInfo[playerid][pPoilce] = level;
I am using Y_ini btw