16.04.2012, 07:40
Just one question, i'm doing it correct?
pawn Код:
enum PlayerInfo
{
Gun[13]
};
new pInfo[MAX_PLAYERS][PlayerInfo];
forward UserDataLoad_data(playerid,name[],value[]);
public UserDataLoad_data(playerid,name[],value[])
{
INI_Int("Weapon1", pInfo[playerid][Gun][1]);
INI_Int("Weapon2", pInfo[playerid][Gun][2]);
INI_Int("Weapon3", pInfo[playerid][Gun][3]);
INI_Int("Weapon4", pInfo[playerid][Gun][4]);
INI_Int("Weapon5", pInfo[playerid][Gun][5]);
INI_Int("Weapon6", pInfo[playerid][Gun][6]);
INI_Int("Weapon7", pInfo[playerid][Gun][7]);
INI_Int("Weapon8", pInfo[playerid][Gun][8]);
INI_Int("Weapon9", pInfo[playerid][Gun][9]);
INI_Int("Weapon10", pInfo[playerid][Gun][10]);
INI_Int("Weapon11", pInfo[playerid][Gun][11]);
INI_Int("Weapon11", pInfo[playerid][Gun][11]);
return 1;
}
public OnPlayerSpawn(playerid)
{
if(pInfo[playerid][Gun])
{
switch(pInfo[playerid][Gun])
{
case 0: GivePlayerWeapon(playerid, pInfo[playerid][Gun][1], 5000);
case 1: GivePlayerWeapon(playerid, pInfo[playerid][Gun][2], 5000);
case 2: GivePlayerWeapon(playerid, pInfo[playerid][Gun][3], 5000);
case 3: GivePlayerWeapon(playerid, pInfo[playerid][Gun][4], 5000);
case 4: GivePlayerWeapon(playerid, pInfo[playerid][Gun][5], 5000);
case 5: GivePlayerWeapon(playerid, pInfo[playerid][Gun][6], 5000);
case 6: GivePlayerWeapon(playerid, pInfo[playerid][Gun][7], 5000);
case 7: GivePlayerWeapon(playerid, pInfo[playerid][Gun][8], 5000);
case 8: GivePlayerWeapon(playerid, pInfo[playerid][Gun][9], 5000);
case 9: GivePlayerWeapon(playerid, pInfo[playerid][Gun][10], 5000);
case 10: GivePlayerWeapon(playerid, pInfo[playerid][Gun][11], 5000);
case 11: GivePlayerWeapon(playerid, pInfo[playerid][Gun][12], 5000);
}
}
return 1;
}