.... oSlot1, oSlot2, oSlot3, oSlot4, oSlot5, oSlot6, oSlot7, oSlot8, oSlot9, oSlot10, oSlot11, oSlot12, oSlot13, ...
INI_WriteInt(File,"oSlot1",-1); INI_WriteInt(File,"oSlot2",-1); INI_WriteInt(File,"oSlot3",-1); INI_WriteInt(File,"oSlot4",-1); INI_WriteInt(File,"oSlot5",-1); INI_WriteInt(File,"oSlot6",-1); INI_WriteInt(File,"oSlot7",-1); INI_WriteInt(File,"oSlot8",-1); INI_WriteInt(File,"oSlot9",-1); INI_WriteInt(File,"oSlot10",-1); INI_WriteInt(File,"oSlot11",-1); INI_WriteInt(File,"oSlot12",-1); INI_WriteInt(File,"oSlot13",-1);
INI_WriteInt(File,"oSlot1",PlayerInfo[playerid][pWeapon0]); INI_WriteInt(File,"Ammo0",PlayerInfo[playerid][pAmmo0]); // Remember to change the variable names to whatever your variable names are.
GivePlayerWeapon(playerid,PlayerInfo[playerid][pWeapon0],PlayerInfo[playerid][pAmmo0]);
Generally speaking, giving players their weapons when they connect is probably a bad idea. Instead, give the weapons to them after spawn. So instead of OnPlayerConnect, try OnPlayerSpawn.
To get the weapon data before they disconnect, read this. To store the weapon data: Код:
INI_WriteInt(File,"oSlot1",PlayerInfo[playerid][pWeapon0]); INI_WriteInt(File,"Ammo0",PlayerInfo[playerid][pAmmo0]); // Remember to change the variable names to whatever your variable names are. Код:
GivePlayerWeapon(playerid,PlayerInfo[playerid][pWeapon0],PlayerInfo[playerid][pAmmo0]); |