19.02.2012, 16:12
havent tested it yet
let me know how it works
could add some error checking and messages but this is the basic.
oh and Ima use this in my GM too.
pawn Код:
new aWeapons[] =
{
"Fist",
"Brass Knuckles",
"Golf Club",
"Nightstick",
"Knife",
"Baseball Bat",
"Shovel",
"Pool Cue",
"Katana",
"Chainsaw",
"Double-ended Dildo",
"Dildo",
"Vibrator",
"Silver Vibrator",
"Flowers",
"Cane",
"Grenade",
"Tear Gas",
"Molotov Cocktail",
"9mm",
"Silenced 9mm",
"Desert Eagle",
"Shotgun",
"Sawnoff Shotgun",
"Combat Shotgun",
"Micro SMG/Uzi",
"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"
};
YCMD:gweapon(playerid, params[], help)
{
if (help)
{
SendClientMessage(playerid, 0xFF0000AA, "Give a player a weapon.");
}
else
{
new str[128], p1, p2[32], p3;
if (isnull(params))
{
format(str, sizeof (str), "Usage: \"/%s [playerid] [weapon name] [ammo amount]\"", Command_GetDisplayNamed("gweapon", playerid));
SendClientMessage(playerid, 0xFF0000AA, str);
}
else
{
if(!sscanf(params, "us[32]i", p1,p2,p3))
{
//
for (new i = 0; i == sizeof(aWeapons); i++)
{
if(strcmp(p2, aWeapons[i], true) == 0)
{
if(p1 != INVALID_PLAYER_ID)
{
GivePlayerWeapon(p1, i, p3);
}
return 1;
}
}
}
}
}
return 1;
}
could add some error checking and messages but this is the basic.
oh and Ima use this in my GM too.