17.02.2016, 05:33
PHP код:
new const shortWeaponNames[48][13] = {
{ "Unarmed" },{ "Knuckles" },{ "Golfclub" },{ "Nightstick" },{ "Knife" },
{ "Bat" },{ "Shovel" },{ "Pool Cue" },{ "Katana" },{ "Chainsaw" },
{ "Dildo" },{ "Vibrator" },{ "Vibrator" },{ "Vibrator" },{ "Flowers" },
{ "Cane" },{ "Grenade" },{ "Teargas" },{ "Molotov" },{ " " },
{ " " },{ " " },{ "Colt 45" },{ "Silenced" },{ "Deagle" },
{ "Shotgun" },{ "Sawnoffs" },{ "Spas" },{ "Micro UZI" },{ "MP5" },
{ "AK47" },{ "M4" },{ "Tec 9" },{ "Rifle" },{ "Sniper" },
{ "Rocket" },{ "RPG" },{ "Flamethrower" },{ "Minigun" },{ "Satchel" },
{ "Detonator" },{ "Spraycan" },{ "Extinguisher" },{ "Camera" },{ "Nightvision" },
{ "Infrared" },{ "Parachute" },{ "Fake Pistol" }
};
stock Ret_PlayerWeapons(playerid) {
new tmp[128]
for ( new slot = 0; slot < 13; slot++ )
{
GetPlayerWeaponData( playerid, slot, weapon, ammo );
if ( weapon != 0 && ammo != 0 )
{
if(slot == 1)
{
format( tmp, sizeof( tmp ), "%s(%d)", shortWeaponNames[ weapon ] , ammo);
}
else
{
format( tmp, sizeof( tmp ), "%s, %s(%d)", tmp, shortWeaponNames[ weapon ] , ammo);
}
}
}
return tmp;
}
PHP код:
CMD:myweapons(playerid) {
new tmpstr[128];
format(tmpstr, sizeof tmpstr, "My Weapons: %s", Ret_PlayerWeapons(playerid))
SendClientMessage(playerid, -1, tmpstr);
return true;
}
