18.10.2014, 07:47
Код:
AC_GivePlayerWeapon(playerid, weaponid, muni) { Sigurnaora[playerid] = 1; GivePlayerWeapon(playerid, weaponid, muni); return 1; }
AC_GivePlayerWeapon(playerid, weaponid, muni) { Sigurnaora[playerid] = 1; GivePlayerWeapon(playerid, weaponid, muni); return 1; }
#define MAX_PLAYERS 32 //Player capacity of your server new weapons[MAX_PLAYERS][13]; //Store the weapon each player should have in a specific slot //Function to give players a weapon giveGun(playerid, weaponid, ammo) { GivePlayerWeapon(playerid, weaponid, ammo); //Keep track of what weapons the player has for(new i = 0; i < 13; i++) { new temp; GetPlayerWeaponData(playerid, i, weapons[playerid][i], temp); } } public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart) { new bool:allowedWeapon = false; for(new i = 0; i < 13; i++) { if(weapons[playerid][i] == weaponid) { allowedWeapon = true; break; } } if(allowedWeapon == false) { //We did not expect the player to have this weapon, they must have cheated! //Do something. } return 1; }