SA-MP Forums Archive
How to use this function? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to use this function? (/showthread.php?tid=403533)



How to use this function? - megamind2067 - 30.12.2012

Код:
GetPlayerArmedWeapon(playerid);
This is what I want to do with it:

Код:
if (GetPlayerArmedWeapon(playerid) = 38) ban(playerid);



Re: How to use this function? - RedCrossER - 30.12.2012

There is no samp function like GetPlayerArmedWeapon(playerid); , I think.
You can Use This Function:
pawn Код:
if(GetPlayerWeapon(playerid) == 38)
            {
            ban(playerid)
            }



Re: How to use this function? - Mr.Anonymous - 30.12.2012

Use this instead:

pawn Код:
if(GetPlayerWeapon(playerid) == 38)
    ban(playerid);



Re: How to use this function? - RedCrossER - 30.12.2012

Quote:
Originally Posted by Mr.Anonymous
Посмотреть сообщение
Use this instead:

pawn Код:
if(GetPlayerWeapon(playerid) == 38)
    ban(playerid);
Doesn't matter with brackets.


Re: How to use this function? - Mr.Anonymous - 30.12.2012

Quote:
Originally Posted by RedCrossER
Посмотреть сообщение
Doesn't matter with brackets.
Why use 4 lines when you can do that in 2? Or even 1.
pawn Код:
if(GetPlayerWeapon(playerid) == 38) ban(playerid);