2021-08-03, 08:33 AM
(This post was last modified: 2021-08-03, 11:46 AM by spyrothedragon96.)
Hello everyone.
I made 3 commands to set the skill level of the weapons, /poor, /gangster and /hitman.
The problem is that when me and the other players die / disconnect, the level goes back to the initial level, that is to the maximum, and the command I had set is not saved.
How can I do to get it saved when one dies / disconnects?
I made 3 commands to set the skill level of the weapons, /poor, /gangster and /hitman.
The problem is that when me and the other players die / disconnect, the level goes back to the initial level, that is to the maximum, and the command I had set is not saved.
How can I do to get it saved when one dies / disconnects?
Quote: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))
{
SetPlayerSkillLevel(i, WEAPONSKILL_PISTOL, 1);
SetPlayerSkillLevel(i, WEAPONSKILL_PISTOL_SILENCED, 1);
SetPlayerSkillLevel(i, WEAPONSKILL_DESERT_EAGLE, 1);
SetPlayerSkillLevel(i, WEAPONSKILL_SHOTGUN, 1);
SetPlayerSkillLevel(i, WEAPONSKILL_SAWNOFF_SHOTGUN, 1);
SetPlayerSkillLevel(i, WEAPONSKILL_SPAS12_SHOTGUN, 1);
SetPlayerSkillLevel(i, WEAPONSKILL_MICRO_UZI, 1);
SetPlayerSkillLevel(i, WEAPONSKILL_MP5, 1);
SetPlayerSkillLevel(i, WEAPONSKILL_AK47, 1);
SetPlayerSkillLevel(i, WEAPONSKILL_M4, 1);
SetPlayerSkillLevel(i, WEAPONSKILL_SNIPERRIFLE, 1);
? ? ? ? }
? ? }
? ? }
return 1;
}
COMMAND:gangster(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))
{
? ? SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 40);
? ? SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, 500);
? ? SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 200);
? ? SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, 200);
? ? SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 200);
? ? SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, 200);
? ? SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 50);
? ? SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, 250);
? ? SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 200);
? ? SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 200);
? ? SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, 300);
? ? ? ? }
? ? }
? ? }
? ? return 1;
}
COMMAND:hitman(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))
{
? ? SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 999);
? ? SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, 999);
? ? SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 999);
? ? SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, 999);
? ? SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 999);
? ? SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, 999);
? ? SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 999);
? ? SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, 999);
? ? SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 999);
? ? SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 999);
? ? SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, 999);
? ? ? ? }
? ? }
? ? }
? ? return 1;
}