Help Rep ++1 - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help Rep ++1 (
/showthread.php?tid=565920)
Help Rep ++1 -
MBilal - 02.03.2015
Код:
#define WEAPON_SLOT_COUNT 13 //0 - 12
new Weapons[MAX_PLAYERS][WEAPON_SLOT_COUNT];
stock GetWeaponSlot(weaponid)
{
new slot;
switch(weaponid)
{
case 0,1: slot = 0;
case 2 .. 9: slot = 1;
case 10 .. 15: slot = 10;
case 16 .. 18, 39: slot = 8;
case 22 .. 24: slot = 2;
case 25 .. 27: slot = 3;
case 28, 29, 32: slot = 4;
case 30, 31: slot = 5;
case 33, 34: slot = 6;
case 35 .. 38: slot = 7;
case 40: slot = 12;
case 41 .. 43: slot = 9;
case 44 .. 46: slot = 11;
}
return slot;
}
stock ServerWeapon(playerid, weaponid, ammo)
{
new slot = GetWeaponSlot(weaponid);
Weapons[playerid][slot] = weaponid;
GivePlayerWeapon(playerid, weaponid, ammo);
}
new weaponid = GetPlayerWeapon(i);
new slot = GetWeaponSlot(weaponid);
if(Weapons[i][slot] != weaponid && weaponid != 46 && weaponid != 0 )
{
WeaponHack(i);
}
why this not working? Help Rep+1
Re: Help Rep ++1 -
MikE1990 - 02.03.2015
Call them somewhere in script and see if you have any errors.
Re: Help Rep ++1 -
MBilal - 02.03.2015
there is not single Error !!...
Re: Help Rep ++1 -
semara123 - 02.03.2015
hmm i think you should try this tutorial this is a good tutorial for you man
https://sampforum.blast.hk/showthread.php?tid=319800
hope this help
Re: Help Rep ++1 -
MBilal - 02.03.2015
That one also not work.. I try that before..!
Re: Help Rep ++1 -
semara123 - 02.03.2015
Quote:
#define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) // put this on top of ur script
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED(KEY_FIRE))
{
switch(GetPlayerWeapon(playerid))
{
case 38, 42: // use ur forbidden gun
{
Ban(playerid);
}
}
}
return 1;
}
|
Tested on local server Hope this help
Re: Help Rep ++1 -
MBilal - 02.03.2015
No dude I dont want to make like this .... I want if admin give player he will not get ban even admin give Minigun to player he will not get banned... , he will ban only when he try to spawn any weapon using any cheat..