Code:
stock WeapSkill_Poor(playerid)
{
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, 1);
return 1;
}
COMMAND:poor(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "Devi loggare come RCON.");
{
for(new i=0; i<MAX_PLAYERS; i)
{
if(!IsPlayerNPC(i) || IsPlayerConnected(i))
{
SetPVarInt(i, "WeapSkill", 1);
WeapSkill_Poor(i);
}
}
}
return 1;
}
You mean, like that?
Try to set PVars - theese are the best for this problems. They are resetting after disconnecting. Define 1 as poor, 2 as gangster, 3 as hitman - and integers in PVars, like in my solution. Next, in OnPlayerSpawn, use WeapSkill_Poor function when PVar "WeapSkill" is set to 1, WeapSkill_Gangster (after you create it) if PVar is set to 2 and so one. If you need to save it after disconnect, use mysql or file manipulation system.