GetWeaponData help
#5

pawn Код:
//under OnPlayerCommand
dcmd(weaps,5,cmdtext);

//dcmd command
dcmd_weaps(playerid,params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new pID, weaposL[320];
        if(sscanf(params, "u",pID))return SendClientMessage(playerid,0xFF0000FF,"Usage: /checkwep [ID]");
        if(!IsPlayerConnected(pID))return SendClientMessage(playerid,0xFF0000FF,"Player ID/Name not found!");
        if(pID == INVALID_PLAYER_ID)return SendClientMessage(playerid,0xFF0000FF,"This PlayerId is invalid!");
        new weapons[13][2],weaponsName[13][32];
        for (new i = 0; i < 13; i++)
        {
            GetPlayerWeaponData(pID, i, weapons[i][0], weapons[i][1]);
            switch(weapons[i][0])
            {
                case 0:weaponsName[i]="Unarmed";
                case 1:weaponsName[i]="Brass Knuckles";
                case 2:weaponsName[i]="Golf Club";
                case 3:weaponsName[i]="Nightstick";
                case 4:weaponsName[i]="Knife";
                case 5:weaponsName[i]="Baseball Bat";
                case 6:weaponsName[i]="Shovel";
                case 7:weaponsName[i]="Pool Cue";
                case 8:weaponsName[i]="Katana";
                case 9:weaponsName[i]="Chainsaw";
                case 10:weaponsName[i]="Dildo 1";
                case 11:weaponsName[i]="Dildo 2";
                case 12:weaponsName[i]="Vibrator 1";
                case 13:weaponsName[i]="Vibrator 2";
                case 14:weaponsName[i]="Flowers";
                case 15:weaponsName[i]="Cane";
                case 16:weaponsName[i]="Grenade";
                case 17:weaponsName[i]="Tear Gas";
                case 18:weaponsName[i]="Molotov Cocktail";
                case 22:weaponsName[i]="9mm Pistol";
                case 23:weaponsName[i]="9mm Pistol silenced";
                case 24:weaponsName[i]="Desert Eagle";
                case 25:weaponsName[i]="Shotgun";
                case 26:weaponsName[i]="SawnOff Shotgun";
                case 27:weaponsName[i]="Combat Shotgun";
                case 28:weaponsName[i]="Micro SMG";
                case 29:weaponsName[i]="MP5";
                case 30:weaponsName[i]="Ak47";
                case 31:weaponsName[i]="M4";
                case 32:weaponsName[i]="Tec9";
                case 33:weaponsName[i]="Country Rifle";
                case 34:weaponsName[i]="Sniper Rifle";
                case 35:weaponsName[i]="RPG";
                case 36:weaponsName[i]="Heat Seeker Rocket";
                case 37:weaponsName[i]="Flamethrower";
                case 38:weaponsName[i]="Minigun";
                case 39:weaponsName[i]="Satchel Charge";
                case 40:weaponsName[i]="Detonator";
                case 41:weaponsName[i]="Sprycan";
                case 42:weaponsName[i]="Fire Extinguisher";
                case 43:weaponsName[i]="Camera";
                case 44:weaponsName[i]="Night Vision Goggles";
                case 45:weaponsName[i]="Thermal Goggles";
                case 46:weaponsName[i]="Parachute";
                default:weaponsName[i]="NONE";
            }
            format(weaposL, sizeof weaposL, "%s Weapon: %s | Ammo: %d\r\n", weaposL, weaponsName[i], weapons[i][1]);
        }
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX,"{EE0000}Weaponlist", weaposL, "Ok", "");
        new name[24],string[128];
        GetPlayerName(pID,name,24);
        format(string,sizeof(string),"{00FF7F}%s's current weapon data is displayed below...",name);
        SendClientMessage(playerid,0xFF0000FF,string);
    }else return SendClientMessage(playerid, 0xFF0000FF, "You are not an admin!");
    return 1;
}
Reply


Messages In This Thread
GetWeaponData help - by Hybris - 22.12.2013, 14:05
Re: GetWeaponData help - by Konstantinos - 22.12.2013, 14:13
Re: GetWeaponData help - by Hybris - 22.12.2013, 15:33
Re: GetWeaponData help - by Konstantinos - 22.12.2013, 15:39
Re: GetWeaponData help - by BlackWolf120 - 22.12.2013, 15:42
Re: GetWeaponData help - by Patrick - 22.12.2013, 15:49
Re: GetWeaponData help - by BlackWolf120 - 22.12.2013, 16:56
Re: GetWeaponData help - by Patrick - 22.12.2013, 17:00
Re: GetWeaponData help - by Hybris - 23.12.2013, 10:15

Forum Jump:


Users browsing this thread: 3 Guest(s)