12.07.2015, 11:33
You can easily do that using "%W" placeholder in format syntax.
Example :
BTW, there's all weapon names :
Here's the code to use this :
Example :
Код:
new msg[128]; format(msg, sizeof(msg), "Your weapon : %W", GetPlayerWeapon(playerid)); SendcClientMessage(playerid, -1, msg);
Код:
new WeaponNames[55][] = //by Sascha { "Fist", "Brass Knuckles", "Golf Club", "Nightstick", "Knife", "Baseball Bat", "Shovel", "Pool Cue", "Katana", "Chainsaw", "Double-ended Dilde", "Dildo", "Vibrator", "Silver Vibrator", "Flowers", "Cane", "Grenade", "Tear Gas", "Molotov Cocktail", "Unknow", "Unknown", "Unknown", "9mm", "Silenced 9mm", "Desert Eagle", "Shotgun", "Sawnoff Shotgun", "Combat Shotgun", "Micro SMG", "MP5", "AK-47", "M4", "Tec-9", "Country Rifle", "Sniper Rifle", "RPG", "HS Rocket", "Flamethrower", "Minigun", "Satchel Charge", "Detonator", "Spraycan", "Fire Extinguisher", "Camera", "Night Vis Goggles", "Thermal Goggles", "Parachute", "Fake Pistol", "Unknown", "Vehicle", "Helicopter Blades", "Explosion", "Unkown", "Drowned", "Spat" };
Код:
new msg[128]; format(msg, sizeof(msg), "Your weapon : %W", WeaponNames[GetPlayerWeapon(playerid)]); SendcClientMessage(playerid, -1, msg);