17.02.2016, 04:55
So I was wondering how to make this command,I advised samp wiki but couldnt find a solution,anyone who helps me gets rep.everyone not just the first one.
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;
}
CMD:myweapons(playerid) {
new tmpstr[128];
format(tmpstr, sizeof tmpstr, "My Weapons: %s", Ret_PlayerWeapons(playerid))
SendClientMessage(playerid, -1, tmpstr);
return true;
}
Could you provide us with more info?
Which game mode are you using? Some commands? /stats would help a lot |
CheckPlayerWeaps(playerid) { new weap, ammo, string[64]; for (new i = 0; i <= 12; i++) { GetPlayerWeaponData(playerid, i, weap, ammo); format(string,sizeof(string),"SLOT: %i. WEAPON: %i, AMMO: %i",i, weap, ammo); SendClientMessage(playerid,-1,string); } return 1; }
CMD:checkweaps(playerid, params[]) { new player; if(!sscanf(params, "r", player)) { CheckPlayerWeaps(player); } else SendClientMessage(playerid, -1 "[USAGE]: /checkweaps [ID player]"); return 1; }