19.05.2014, 17:41
(
Последний раз редактировалось PrivatioBoni; 19.05.2014 в 17:58.
Причина: Fixed
)
FIXED - forgot to use ResetPlayerWeapons before giveweapon(playerid);
Hello,
This is a major problem with my server at the moment and I can't think of any way of resolving it.
Basically, I have a server side weapon system, and below is the 'giveweapon' code.
Here is (an example of) where the code will have problems:
The giveweapon function seems to double the ammo of the weapons.
Hello,
This is a major problem with my server at the moment and I can't think of any way of resolving it.
Basically, I have a server side weapon system, and below is the 'giveweapon' code.
pawn Код:
forward giveweapon(playerid);
public giveweapon(playerid)
{
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon1], PlayerInfo[playerid][Ammo1]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon2], PlayerInfo[playerid][Ammo2]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon3], PlayerInfo[playerid][Ammo3]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon4], PlayerInfo[playerid][Ammo4]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon5], PlayerInfo[playerid][Ammo5]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon6], PlayerInfo[playerid][Ammo6]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon7], PlayerInfo[playerid][Ammo7]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon8], PlayerInfo[playerid][Ammo8]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon9], PlayerInfo[playerid][Ammo9]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon10], PlayerInfo[playerid][Ammo10]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon11], PlayerInfo[playerid][Ammo11]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon12], PlayerInfo[playerid][Ammo12]);
}
pawn Код:
// the buying a baseball bat code (for example)
PlayerInfo[playerid][Weapon1] = 5;
PlayerInfo[playerid][Ammo1] = 1;
giveweapon(playerid);