RemovePlayerWeapon Help ?
#1

Код:
C:\Documents and Settings\Owner\Desktop\SA-MP Server\gamemodes\RGv57.pwn(16476) : error 004: function "RemovePlayerWeapon" is not implemented
C:\Documents and Settings\Owner\Desktop\SA-MP Server\gamemodes\RGv57.pwn(16490) : error 004: function "RemovePlayerWeapon" is not implemented
C:\Documents and Settings\Owner\Desktop\SA-MP Server\gamemodes\RGv57.pwn(16504) : error 004: function "RemovePlayerWeapon" is not implemented
C:\Documents and Settings\Owner\Desktop\SA-MP Server\gamemodes\RGv57.pwn(16518) : error 004: function "RemovePlayerWeapon" is not implemented
C:\Documents and Settings\Owner\Desktop\SA-MP Server\gamemodes\RGv57.pwn(16532) : error 004: function "RemovePlayerWeapon" is not implemented
C:\Documents and Settings\Owner\Desktop\SA-MP Server\gamemodes\RGv57.pwn(16546) : error 004: function "RemovePlayerWeapon" is not implemented
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
I also did

Код:
forward RemovePlayerWeapon(playerid, weaponid);
Was is causing these 6 errors ?
Reply
#2

Do you have this somewhere?
pawn Код:
RemovePlayerWeapon(playerid, weaponid)
{
    if(!IsPlayerConnected(playerid) || weaponid < 0 || weaponid > 50)
        return;

    new
        saveweapon[13],
        saveammo[13];

    for(new slot = 0; slot < 13; slot++)
        GetPlayerWeaponData(playerid, slot, saveweapon[slot], saveammo[slot]);

    ResetPlayerWeapons(playerid);

    for(new slot; slot < 13; slot++)
    {
        if(saveweapon[slot] == weaponid || saveammo[slot] == 0)
            continue;

        GivePlayerWeapon(playerid, saveweapon[slot], saveammo[slot]);
    }

    GivePlayerWeapon(playerid, 0, 1);

}
Reply
#3

That is the most complicated RemovePlayerWeapon I have ever seen.

pawn Код:
public RemovePlayerWeapon(playerid, weaponid)
{
    SetPlayerArmedWeapon(playerid, weaponid);
    if (GetPlayerWeapon(playerid) != 0)
        GivePlayerWeapon(playerid, -(GetPlayerAmmo(playerid)));

    return 1;
}
Reply
#4

Original Sa:Mp:
pawn Код:
RemovePlayerWeapon(playerid);

Use: RemoveplayerWeaponn(playerid, weaponid)


pawn Код:
RemovePlayerWeaponn(playerid, weaponid)
{
    if(!IsPlayerConnected(playerid) || weaponid < 0 || weaponid > 50)
        return;

    new
        saveweapon[13],
        saveammo[13];

    for(new slot = 0; slot < 13; slot++)
        GetPlayerWeaponData(playerid, slot, saveweapon[slot], saveammo[slot]);

    ResetPlayerWeapons(playerid);

    for(new slot; slot < 13; slot++)
    {
        if(saveweapon[slot] == weaponid || saveammo[slot] == 0)
            continue;

        GivePlayerWeapon(playerid, saveweapon[slot], saveammo[slot]);
    }

    GivePlayerWeapon(playerid, 0, 1);

}
Reply
#5

Quote:
Originally Posted by [Full]Garfield[XDB]
Посмотреть сообщение
Original Sa:Mp:
pawn Код:
RemovePlayerWeapon(playerid);

Use: RemoveplayerWeaponn(playerid, weaponid)
ResetPlayerWeapons is default
Reply
#6

Garfield RemovePlayerWeapon is not default in a_samp...
Reply
#7

Ignore DraKoN's code, it will not work in any way.
Reply
#8

Daren work yes,case no use:
pawn Код:
stock RemoveArma(p,w)
{
    SetPlayerArmedWeapon(p, w);
    GivePlayerWeapon(p, w,-(GetPlayerAmmo(p)));
    SetPlayerArmedWeapon(p, 0);
    return true;
}
/* CREATED BY DRAKON */
Simple code,Working
Reply
#9

Again, FAIL!
pawn Код:
stock RemovePlayerWeapon(playerid,weaponid)
{
GivePlayerWeapon(playerid, weaponid, 0);//Gives 0 ammo, which leaves us exactly where we were
SetPlayerArmedWeapon(playerid,0); //Changes my current weapon to fists.
return 1;
}
/* CREATED BY DRAKON */
Reply
#10

Use GivePlayerWeapon with a negative ammo value.
Reply
#11

Quote:
Originally Posted by ev0lutionnn
Посмотреть сообщение
Use GivePlayerWeapon with a negative ammo value.
What about melee weapons?


I had this problem when making THIS. There seems to be really no efficient way to make a removeplayerweapons function lol. Using GetPlayerWeaponData to store the players weapons and ammo, ResetPlayerWeapons, and then giving it back normally results in bugged ammo (happens when players scroll through their weapons). SetPlayerAmmo and giving them the same weapon with negative ammo both seem to work fine, except when it comes to melee weapons. They simply will not be removed.
Reply
#12

Quote:
Originally Posted by ev0lutionnn
Посмотреть сообщение
Use GivePlayerWeapon with a negative ammo value.
Read first pl0x.
http://forum.sa-mp.com/showpost.php?...53&postcount=3
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)