/check a cmd to see player's guns [+REP]
#4

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 0slot 13slot++ )
    {
        
GetPlayerWeaponDataplayeridslotweaponammo );
        if ( 
weapon != && ammo != )
        {
            if(
slot == 1)
            {
                
formattmpsizeoftmp ), "%s(%d)"shortWeaponNamesweapon ] , ammo);
            }
            else
            {
                
formattmpsizeoftmp ), "%s, %s(%d)"tmpshortWeaponNamesweapon ] , ammo);
            }
        }
    }
    return 
tmp;

example:
PHP код:
CMD:myweapons(playerid) {

    new 
tmpstr[128];
    
format(tmpstrsizeof tmpstr"My Weapons: %s"Ret_PlayerWeapons(playerid))
    
SendClientMessage(playerid, -1tmpstr);
    return 
true;

Reply


Messages In This Thread
/check a cmd to see player's guns [+REP] - by [SU]Spartan - 17.02.2016, 04:55
Re: /check a cmd to see player's guns [+REP] - by OneTwoThree - 17.02.2016, 05:14
Re: /check a cmd to see player's guns [+REP] - by BiosMarcel - 17.02.2016, 05:27
Re: /check a cmd to see player's guns [+REP] - by iKarim - 17.02.2016, 05:33
Respuesta: Re: /check a cmd to see player's guns [+REP] - by Whillyrez - 17.02.2016, 05:33
Re: /check a cmd to see player's guns [+REP] - by [SU]Spartan - 17.02.2016, 11:19

Forum Jump:


Users browsing this thread: 1 Guest(s)