Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include a_samp
- /*
- here you adding black list weapons
- */
- new BlackList[2] = {38,35};
- #define ACTION_BLACKLIST 1
- /*
- 1 = replace weapon.
- 2 = reset all weapon.
- just use only:
- CheckBlackList(playerid);
- in public or timer.
- */
- #define FIND_MESSAGE_REMOVE_ALL "Ehm.. we found prohibited weapon! we removed you all weapons. next time dont use: %s"
- #define FIND_MESSAGE_REPLACE "We found prohibited weapon! we removed from your inventory this weapon: %s"
- forward CheckBlackList(i);
- public CheckBlackList(i)
- {
- for(new j; j < sizeof(BlackList); j ++)
- {
- switch(ACTION_BLACKLIST)
- {
- case 1:
- {
- if(GetPlayerWeapon(i) == BlackList[j])
- {
- new str[256];
- format(str,sizeof(str),FIND_MESSAGE_REPLACE,WeaponName(GetPlayerWeapon(i)));
- SendClientMessage(i,-1,str);
- ReplaceThisWeapon(i);
- }
- }
- case 2:
- {
- if(GetPlayerWeapon(i) == BlackList[j])
- {
- new str[256];
- format(str,sizeof(str),FIND_MESSAGE_REMOVE_ALL,WeaponName(GetPlayerWeapon(i)));
- SendClientMessage(i,-1,str);
- ResetPlayerWeapons(i);
- }
- }
- }
- }
- }
- stock ReplaceThisWeapon(playerid)
- {
- new weapons[13][2];
- for (new i = 0; i <= 12; i++)
- {
- GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
- }
- ResetPlayerWeapons(playerid);
- for (new i = 0; i <= 12; i++)
- {
- for(new j; j < sizeof(BlackList); j ++)
- {
- if(weapons[i][0] != BlackList[j])
- {
- GivePlayerWeapon(playerid, weapons[i][0], weapons[i][1]);
- }
- }
- }
- }
- stock WeaponName(weapon)
- {
- new str[20];
- switch(weapon)
- {
- case 0: strcat(str,"nothing");
- case 1: strcat(str,"Brass Knuckles");
- case 2: strcat(str,"Golf Club");
- case 3: strcat(str,"Nightstick");
- case 4: strcat(str,"knife");
- case 5: strcat(str,"Baseball Bat");
- case 6: strcat(str,"shovel");
- case 7: strcat(str,"Pool Cue");
- case 8: strcat(str,"katana");
- case 9: strcat(str,"Chainsaw");
- case 10: strcat(str,"Purple dildo");
- case 11: strcat(str,"dildo");
- case 12: strcat(str,"vibrator");
- case 13: strcat(str,"silver dildo");
- case 14: strcat(str,"Flowers");
- case 15: strcat(str,"Cane");
- case 16: strcat(str,"Grenade");
- case 17: strcat(str,"Tear Gas");
- case 18: strcat(str,"Molotov Cocktail");
- case 22: strcat(str,"9mm");
- case 23: strcat(str,"Silenced 9mm");
- case 24: strcat(str,"desert eagle");
- case 25: strcat(str,"shotgun");
- case 26: strcat(str,"sawnoff shotgun");
- case 27: strcat(str,"combat shotgun");
- case 28: strcat(str,"Uzi");
- case 29: strcat(str,"mp5");
- case 30: strcat(str,"ak47");
- case 31: strcat(str,"m4a1");
- case 32: strcat(str,"tec 9");
- case 33: strcat(str,"country rifle");
- case 34: strcat(str,"sniper rifle");
- case 35: strcat(str,"RPG");
- case 36: strcat(str,"hs rocket");
- case 37: strcat(str,"flamethrower");
- case 38: strcat(str,"minigun");
- case 39: strcat(str,"satchel charge");
- case 40: strcat(str,"detonator");
- case 41: strcat(str,"Spraycan");
- case 42: strcat(str,"Fire Extinguisher");
- case 43: strcat(str,"Camera");
- case 44: strcat(str,"Night Vis Goggles");
- case 45: strcat(str,"Thermal Goggles");
- case 46: strcat(str,"Parachute");
- }
- return str;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement