09.09.2013, 13:38
This is a small part of the callback I use to give the saved guns back after the player been on /adminduty
When I have the commented lines as a comment I get the weapons I had before going on admin duty but I also gets more ammo each time I go off admin duty and will allways spawn with those weapons. Un-comment the lines I don't get any weapon that I had before going on admin duty.
So.. How can I make it so I will get the weapons I had before going on admin duty but it wont increase the ammo each time I go off aduty?
pawn Код:
public SetPlayerWeapons(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJailed] < 1)
{
if(Spectate[playerid] == 255)
{
if (PlayerInfo[playerid][pWeapon] > 0)
{
SafeGivePlayerWeapon(playerid, PlayerInfo[playerid][pWeapon], PlayerInfo[playerid][pAmmo]);
//PlayerInfo[playerid][pWeapon] = 0; PlayerInfo[playerid][pAmmo] = 0;
}
if (PlayerInfo[playerid][pWeapon2] > 0)
{
SafeGivePlayerWeapon(playerid, PlayerInfo[playerid][pWeapon2], PlayerInfo[playerid][pAmmo2]);
//PlayerInfo[playerid][pWeapon2] = 0; PlayerInfo[playerid][pAmmo2] = 0;
}
if (PlayerInfo[playerid][pWeapon3] > 0)
{
SafeGivePlayerWeapon(playerid, PlayerInfo[playerid][pWeapon3], PlayerInfo[playerid][pAmmo3]);
//PlayerInfo[playerid][pWeapon3] = 0; PlayerInfo[playerid][pAmmo3] = 0;
}
So.. How can I make it so I will get the weapons I had before going on admin duty but it wont increase the ammo each time I go off aduty?