SA-MP Forums Archive
Free weapon GiveAway - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Free weapon GiveAway (/showthread.php?tid=237188)



Free weapon GiveAway - wheelman_WM - 09.03.2011

He i want help about i want a script in which anyplayer id recieves any weapons freeaway.


Re: Free weapon GiveAway - admantis - 09.03.2011

pawn Код:
stock GiveLoopWeapon(weapon_id)
{
     for (new p = 0; p < MAX_PLAYERS; p++) { GivePlayerWeapon(p, weapon_id, 9999); }
}
Usage:
pawn Код:
GiveLoopWeapon(22); // Gives Desert Eagle to all.



Re: Free weapon GiveAway - wheelman_WM - 09.03.2011

can i see this code anywhere


Re: Free weapon GiveAway - wheelman_WM - 09.03.2011

showing error
C:\Users\Bhupesh\Downloads\Compressed\samp\gamemod es\lvdm.pwn(513) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Can u make a fs or give me a fs code here


Re: Free weapon GiveAway - ElChapoGuzman - 09.03.2011

Quote:
Originally Posted by wheelman_WM
Посмотреть сообщение
showing error
C:\Users\Bhupesh\Downloads\Compressed\samp\gamemod es\lvdm.pwn(513) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Can u make a fs or give me a fs code here
it actually works lol


Re: Free weapon GiveAway - Mean - 09.03.2011

Well, example with ZCMD
pawn Код:
stock GiveLoopWeapon(weapon_id)
{
     for (new p = 0; p < MAX_PLAYERS; p++) { GivePlayerWeapon(p, weapon_id, 9999); }
}

CMD:sawntoall( playerid, params[ ] )
{
    GiveLoopWeapon( 26 );
    return 1;
}
Gives sawnoffs to everyone.

EDIT: In loops, to reduce lag, you should use IsPlayerConnected.

pawn Код:
stock GiveLoopWeapon(weapon_id)
{
     for (new p = 0; p < MAX_PLAYERS; p++) if(IsPlayerConnected(p)) { GivePlayerWeapon(p, weapon_id, 9999); }
}