name of the guns
#1

Guys im new in pawn, and i made this cmd but i want then when i give a weapon to anyone say what name of the weapon i gave to any player, of course just to me the admin
Reply
#2

https://sampwiki.blast.hk/wiki/GetWeaponName
Reply
#3

dont work for me
Reply
#4

PHP код:

new gunname[32];
                
GetWeaponName(gungunnamesizeof(gunname));
                
format(stringsizeof(string), "You have given gun %s (ID: %d) to %s!"gunnamegunGetName(target));
                
SendClientMessage(playeridCOLOR_WHITEstring); 
Reply
#5

removed
Reply
#6

PHP код:
CMD:givegun(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 3)
    {
        new 
targetgunstring[128];
        if(
sscanf(params"ud"targetgun))
        {
            
SendClientMessage(playeridCOLOR_WHITE"USAGE: /givegun [PlayerID] [Weapon ID]");
            
SendClientMessage(playeridCOLOR_GREEN,"|__________________| Weapon Menu |__________________|");
            
SendClientMessage(playeridCOLOR_WHITE"1: Brass Knuckles 2: Golf Club 3: Nite Stick 4: Knife 5: Baseball Bat 6: Shovel 7: Pool Cue 8: Katana 9: Chainsaw");
            
SendClientMessage(playeridCOLOR_WHITE"10: Purple Dildo 11: Small White Vibrator 12: Large White Vibrator 13: Silver Vibrator 14: Flowers 15: Cane 16: Frag Grenade");
            
SendClientMessage(playeridCOLOR_WHITE"17: Tear Gas 18: Molotov Cocktail 19: Vehicle Missile 20: Hydra Flare 21: Jetpack 22: 9mm 23: Silenced 9mm 24: Deagle 25: Shotgun");
            
SendClientMessage(playeridCOLOR_WHITE"26: Sawnoff Shotgun 27: Combat Shotgun 28: Micro SMG (Mac 10) 29: SMG (MP5) 30: AK-47 31: M4 32: Tec9 33: Country Rifle");
            
SendClientMessage(playeridCOLOR_WHITE"34: Sniper Rifle 35: Rocket Launcher 36: HS Rocket Launcher 37: Flamethrower 38: Minigun 39: Satchel Charge");
            
SendClientMessage(playeridCOLOR_WHITE"40: Detonator 41: Spraycan 42: Fire Extinguisher 43: Camera 44: Nightvision Goggles 45: Infared Goggles 46: Parachute");
            
SendClientMessage(playeridCOLOR_GREEN,"_____________________________________________________");
            return 
1;
        }
        if(
gun || gun 46) { SendClientMessage(playeridCOLOR_WHITE"Don't go below 1 or above 47."); return 1; }
        if(
IsPlayerConnected(target))
        {
            if(
target != INVALID_PLAYER_ID)
            {
                if(
gun == 21)
                {
                    
SetPlayerSpecialAction(targetSPECIAL_ACTION_USEJETPACK);
                }
                
GivePlayerWeapon(targetgun99999);
               new 
gunname[32]; 
                
GetWeaponName(gungunnamesizeof(gunname)); 
                
format(stringsizeof(string), "You have given gun %s (ID: %d) to %s!"gunnamegunGetName(target)); 
                
SendClientMessage(playeridCOLOR_WHITEstring);  
            }
        }
    }
    else
    {
        
SendClientMessage(playeridCOLOR_WHITE"You are not authorized to use that command!");
        return 
1;
    }
    return 
1;

Reply
#7

WORKS THANKS !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)