remove weapon
#1

i wanna make a cmd for remove weapons
RemovePlayerWeapon(playerid, 38, 50000);
and i get this error
pawn Код:
D:\Jocuri\Gta san andreas\CBM\Training server\Admin\filterscripts\XtremeAdmin2.pwn(757) : error 017: undefined symbol "RemovePlayerWeapon"
Reply
#2

pawn Код:
// At The Bottom
stock RemovePlayerWeapon(playerid, pweaponid)
{
        new plyWeapons[12];
        new plyAmmo[12];
 
        for(new slot = 0; slot != 12; slot++)
        {
                new pwep, pammo;
                GetPlayerWeaponData(playerid, slot, pwep, pammo);
 
                if(pwep != pweaponid)
                {
                        GetPlayerWeaponData(playerid, slot, plyWeapons[slot], plyAmmo[slot]);
                }
        }
 
        ResetPlayerGuns(playerid);
        for(new slot = 0; slot != 12; slot++)
        {
                GivePlayerGun(playerid, plyWeapons[slot], plyAmmo[slot]);
        }
}
Reply
#3

i need just that command for remove weapon
i get this errors
pawn Код:
D:\Jocuri\Gta san andreas\CBM\Training server\Admin\filterscripts\XtremeAdmin2.pwn(757) : error 017: undefined symbol "ResetPlayerWeapon"
D:\Jocuri\Gta san andreas\CBM\Training server\Admin\filterscripts\XtremeAdmin2.pwn(757) : error 017: undefined symbol "ResetPlayerWeapon"
D:\Jocuri\Gta san andreas\CBM\Training server\Admin\filterscripts\XtremeAdmin2.pwn(1226) : warning 235: public function lacks forward declaration (symbol "OnPlayerPrivmsg")
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Reply
#4

its ResetPlayerWeapons, and for the public..

You need to Forward the public since its custom defined
Reply
#5

I tested and it works.
pawn Код:
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase
pawn Код:
CMD:removeweap( playerid, params[ ] )
{
    new
        id, weapon;

    if( sscanf( params, "ri", id, weapon ) ) return SendClientMessage( playerid, -1, "Usage: /removeweap <ID/Part Of Name> <Weapon ID>" );
    if( id == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, "That player isn't connected!" );
    RemovePlayerWeapon( id, weapon );
    return 1;
}

stock RemovePlayerWeapon( playerid, weaponid )
{
    new
        plyWeapons[ 12 ], plyAmmo[ 12 ];

    for( new slot = 0; slot != 12; slot ++ )
    {
        new
            weap, ammo;
           
        GetPlayerWeaponData( playerid, slot, weap, ammo );
        if( weap != weaponid )
        {
            GetPlayerWeaponData( playerid, slot, plyWeapons[ slot ], plyAmmo[ slot ] );
        }
    }
    ResetPlayerWeapons( playerid );
    for( new slot = 0; slot != 12; slot ++ )
    {
        GivePlayerWeapon( playerid, plyWeapons[ slot ], plyAmmo[ slot ] );
    }
}
Reply
#6

Why not just RemoveWeaponFromSlot(playerid, 7);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)