//-----[Server GMX]-----
CMD:gmx(playerid, params[])
{
SaveUserDate(playerid);
SetTimer("Gmx",3000,false);
SendRconCommand("gmx");
return 1;
}
forward SaveUserDate(playerid);
public SaveUserDate(playerid)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Skin",GetPlayerSkin(playerid));
INI_Close(File);
return true;
}
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Password",PlayerInfo[playerid][Password]);
INI_Int("Cash",PlayerInfo[playerid][Cash]);
INI_Int("Kills",PlayerInfo[playerid][Kills]);
INI_Int("Deaths",PlayerInfo[playerid][Deaths]);
INI_Int("Score",PlayerInfo[playerid][Score]);
INI_Int("Adminlevel",PlayerInfo[playerid][Adminlevel]);
INI_Int("Skin",PlayerInfo[playerid][Skin]);
return 1;
}
forward SaveUserDate(playerid);
public SaveUserDate(playerid)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
PlayerInfo[playerid][Skin] = GetPlayerSkin(playerid);
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Kills",PlayerInfo[playerid][Kills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][Deaths]);
INI_WriteInt(File,"Score",GetPlayerScore(playerid));
INI_WriteInt(File,"Adminlevel",PlayerInfo[playerid][Adminlevel]);
INI_WriteInt(File,"Skin", GetPlayerSkin(playerid));
INI_Close(File);
return true;
}
for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { SaveUserData(i); }}
public OnPlayerSpawn(playerid)
{
SetSpawnInfo( playerid, 0, PlayerInfo[playerid][Skin], 2842.7844,1290.9116,11.3906,93.5261, 0, 0, 0, 0, 0, 0 );
SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetSpawnInfo( playerid, 0, PlayerInfo[playerid][Skin], 2842.7844,1290.9116,11.3906,93.5261, 0, 0, 0, 0, 0, 0 );
SpawnPlayer(playerid);
return 1;
}
CMD:gmx(playerid, params[])
{
for(new i=0; i<MAX_PLAYERS; i++)
SaveUserDate(i);
SetTimer("Gmx",3000,false);
SendRconCommand("gmx");
return 1;
}
pawn Код:
|
Where do you call INI_ParseFile? You might want to look in to this system:
https://sampforum.blast.hk/showthread.php?tid=279986 |
You have the "LoadUser_data" callback, but no evidence of "INI_ParseFile", which is used to call those callbacks. There are tutorials on y_ini use - see the "My Threads" link in my signature.
|
//-----[Server GMX]-----
CMD:gmx(playerid, params[])
{
SaveUserDate(playerid);
SetTimer("Gmx",3000,false); // <---- About this
SendRconCommand("gmx"); // <---- And this
return 1;
}
SendRconCommand("gmx");