if(newkeys & KEY_SECONDARY_ATTACK || newkeys & KEY_FIRE || newkeys & KEY_ACTION && GetPlayerWeapon(playerid) != 0)
{
if(sSecure[DETECT_WEAPON] == 1)
{
if(!CheckWeapons(playerid))
{
new m_weapons[13][2];
for (new x=0; x<13; x++)
{
GetPlayerWeaponData(playerid, x, m_weapons[x][0], m_weapons[x][1]);
}
pClient[playerid][SECURE_DELAY] = gettime()+3;
format(pClient[playerid][STRING_MEDIUM],SIZE_MEDIUM,""COLOR_GREY" %s(%d) > probably corrupted [weapons:onfoot]",pGeneral[playerid][PLR_NAME],playerid);
AdminMessage(pClient[playerid][STRING_MEDIUM]);
format(pClient[playerid][SECURE_WARN_TXT],26,"corrupted weapons");
pClient[playerid][SECURE_WARN]++;
return 1;
}
}
}
|
stock GiveWeapon(playerid,weapon,ammo) { format(str,10,"weap%d",weapon); SetPVarInt(playerid,str,1); format(str,10,"wslot%d",GetWeaponSlot(weapon)); SetPVarInt(playerid,str,weapon); format(str,10,"weapammu%d",weapon); SetPVarInt(playerid,str,ammo); format(str,10,"weapammumax%d",weapon); SetPVarInt(playerid,str,ammo); GivePlayerWeapon(playerid,weapon,ammo); } |
|
new store[10]; format(store,10,"wslot%d",GetWeaponSlot(weaponid)) ; if(GetPVarInt(playerid,store) != weaponid && weaponid != 46) { // report to admins ResetPlayerWeapons(playerid); for(new i = 1; i <= 34; i++) { format(store,10,"weap%d",i); if(GetPVarInt(playerid,store) == 1) { format(store,10,"weapammu%d",i); GivePlayerWeapon(playerid,i,GetPVarInt(playerid,st ore)); } } return 0;//Shot wont be fired } |
|
i dont recommand to use onplayerkeystatechange
listen carfuly dont give weapons by GivePlayerWeapon, Create a stock GiveWeapon int the stock save the weapons data like this: than go to OnPlayerWeaponShot and check if have the weapon that he shoot with like this: then you dont need to kick someone because it is reset his weapons, dont let him shot because we returned 0 and give him again the weapons. have fun, and if you liked it leave a +rep sorry for my english ![]() |