Question about saving player inventory before duty and gethim back when off duty
#3

Quote:
Originally Posted by 5002
View Post
//////

enum PDATA
{
pPolice,
pskin,
pweapon,
pammo,
pcolor,
parmour
}
new pinfo[MAX_PLAYER][PDATA];


public OnPlayerDisconnect(playerid, reason)
{
if(pinfo[playerid][pPolice] = 1 || pinfo[playerid][pPolice] > 1)
{
new pweapon = GetPlayerWeapon(playerid);//weapon
new pammo = GetPlayerAmmo(playerid);//ammo
new pskin = GetPlayerSkin(playerid);//skin
new pcolor = GetPlayerColor(playerid);//color
new parmour = GetPlayerArmour(playerid
new policelevel = pinfo[playerid][pPolice] ;
mysql_format(policemod,128,"UPDATE 'Players' SET 'pPolice' = %i, 'pskin' = %i , 'pweapon' = %i , 'pammo' = %i , 'pcolor' = %i , 'parmour' = %i WHERE 'USERNAME' = %s" ,policelevel, pskin,pweapon,pammo,pcolor,parmour,pinfo[playerid][pname]);
mysql_query(policemod);
return 1;
}
}
now data save if player dc
and i must rtry this when he use cmd to save then load when he go off?

and if player dc when are in duty
table updated and last stats lost!and police stats will save at table
and .... im confuse😥😅
Hello, to save the values, use some .INI writer and reader, such as DOF2, or YINI, so you can save the values ​​of the player's variables when they disconnect, then you can apply the values ​​back to the variables when they log in.
Reply


Messages In This Thread
Question about saving player inventory before duty and gethim back when off duty - by 5002 - 20.01.2019, 08:16
Re: Question about saving player inventory before duty and gethim back when off duty - by 5002 - 20.01.2019, 11:17
Re: Question about saving player inventory before duty and gethim back when off duty - by ApolloScripter - 20.01.2019, 14:20
Re: Question about saving player inventory before duty and gethim back when off duty - by 5002 - 20.01.2019, 15:41

Forum Jump:


Users browsing this thread: 1 Guest(s)