Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <sscanf2>
- #include <zcmd>
- CMD:weapon(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid))
- {
- SendClientMessage(playerid, 0xFF0000FF, "Error: You must be an RCON admin to use this command!");
- return 1;
- }
- new weaponid;
- if(sscanf(params, "i", weaponid))
- {
- SendClientMessage(playerid, 0xFFFF00FF, "Usage: /weapon [weapon_id]");
- SendClientMessage(playerid, 0xFFFF00FF, "Valid IDs: 70-92, 99-175");
- return 1;
- }
- new bool:isValid = (weaponid >= 70 && weaponid <= 92) || (weaponid >= 99 && weaponid <= 175);
- switch(isValid)
- {
- case true:
- {
- GivePlayerWeapon(playerid, weaponid, 100);
- new string[128];
- format(string, sizeof(string), "You have received weapon ID %d.", weaponid);
- SendClientMessage(playerid, 0x00FF00FF, string);
- }
- case false:
- {
- SendClientMessage(playerid, 0xFF0000FF, "Error: Invalid weapon ID! Valid IDs: 70-92, 99-175");
- }
- }
- return 1;
- }
Advertisement
Comments
-
- A weapon spawner for Stars And Stripes Multiplayer.
Add Comment
Please, Sign In to add comment
Advertisement