how to save this with (y_ini) - 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)
+--- Thread: how to save this with (y_ini) (
/showthread.php?tid=592783)
how to save this with (y_ini) -
ahameed4755 - 29.10.2015
how to save playerdata(admin level) with y_ini;
Код:
CMD:setadmin(playerid, params[])
{
new targetid[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], admlvl, id;
if(IsPlayerAdmin(playerid))
{
if (sscanf(params, "ui", id, admlvl)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /setadmin [id] [adminlevel]");
if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "System: Invalid ID");
if (admlvl > 5 || admlvl < 0) return SendClientMessage(playerid, COLOR_RED,"System: Valid Admin Levels: 1-5!");
PlayerInfo[id][pAdminLevel] = admlvl;
GetPlayerName(id, targetid, sizeof(targetid));
GetPlayerName(playerid, adminname, sizeof(adminname));
new str[128];
format(str,128,"System: %s [ID %d] has set %s [ID %d] admin level to %i",adminname, playerid, targetid, id, admlvl);
SendClientMessage(playerid,COLOR_GREEN,str);
return 1;
}
else return SendClientMessage(playerid,COLOR_RED," [ERROR]:You are not (rcon admin)!");
}
Re: how to save this with (y_ini) -
ahameed4755 - 29.10.2015
Fast plz
Re: how to save this with (y_ini) -
Private200 - 29.10.2015
The player stats will get saved when the player will disconnect since you're not dealing with an offline stats changing at this command.
Re: how to save this with (y_ini) -
ahameed4755 - 29.10.2015
no its not saving..
i made my self admin level 3
but when i reconnect it gets to 0 ..
Re: how to save this with (y_ini) -
Private200 - 29.10.2015
Show me your OnPlayerDisconnect lines (where your account saves)