SA-MP Forums Archive
a idea for disarm all players and give all players ? - 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: a idea for disarm all players and give all players ? (/showthread.php?tid=606166)



a idea for disarm all players and give all players ? - Saliim - 30.04.2016

Hi, you have a idea for disarm all players, after idea for give weapons for all players


Re: a idea for disarm all players and give all players ? - oMa37 - 30.04.2016

Something like this?
PHP Code:
CMD:weapons(playerid,params[])
{
    foreach(
Playeri)
    {
           
ResetPlayerWeapons(i);
           
GivePlayerWeapon(i381000000);
    }
    return 
1;




Re: a idea for disarm all players and give all players ? - CalvinC - 30.04.2016

Loop
ResetPlayerWeapons
GivePlayerWeapon


Re: a idea for disarm all players and give all players ? - Saliim - 30.04.2016

thanks all


Re: a idea for disarm all players and give all players ? - MBilal - 30.04.2016

You can use this code to giveallweapon Code
Code:
CMD:giveallweapon(playerid,params[])
{ 
        new weap[32], ammo;
	    if(sscanf(params, "s[32]i", weap,ammo)) return SCM(playerid,-1, "Use : /Giveallweapon <Weapon ID> <Ammo>");
 
	    if(weapid < 1 || weapid > 46) return SCM(playerid, -1, "Invalid weapon ID/Name!");
 
  		foreach(Player, i)
		{ 
           	Giveallweapon(i, weapid, ammo);
		   }
	    }
 
}



Re: a idea for disarm all players and give all players ? - Saliim - 30.04.2016

i don't wan't a commande ^^, i wan't only a idea for disarm all players, and give weapon for all players


Re: a idea for disarm all players and give all players ? - Saliim - 30.04.2016

Quote:
Originally Posted by oMa37
View Post
Something like this?
PHP Code:
CMD:weapons(playerid,params[])
{
    foreach(
Playeri)
    {
           
ResetPlayerWeapons(i);
           
GivePlayerWeapon(i381000000);
    }
    return 
1;

i test, not work,

Code:
#include <foreach>
i have add in my timer
Code:
forward changearme(playerid, params[]);
public changearme(playerid, params[])
{
    foreach(Player, i)
    {
           ResetPlayerWeapons(i);
           GivePlayerWeapon(i, 9, 1);
           GameTextForPlayer(i, "WwX MOV ~r~[Chainsaw]~n~~w~Mort ou Vif",2000,6);
	}
return 1;
}



Re: a idea for disarm all players and give all players ? - oMa37 - 30.04.2016

Quote:
Originally Posted by Saliim
View Post
i test, not work,

Code:
#include <foreach>
i have add in my timer
Code:
forward changearme(playerid, params[]);
public changearme(playerid, params[])
{
    foreach(Player, i)
    {
           ResetPlayerWeapons(i);
           GivePlayerWeapon(i, 9, 1);
           GameTextForPlayer(i, "WwX MOV ~r~[Chainsaw]~n~~w~Mort ou Vif",2000,6);
	}
return 1;
}
Try it with loop


Re: a idea for disarm all players and give all players ? - Ritzy2K - 30.04.2016

Quote:
Originally Posted by Saliim
View Post
i test, not work,

Code:
#include <foreach>
i have add in my timer
Code:
forward changearme(playerid, params[]);
public changearme(playerid, params[])
{
    foreach(Player, i)
    {
           ResetPlayerWeapons(i);
           GivePlayerWeapon(i, 9, 1);
           GameTextForPlayer(i, "WwX MOV ~r~[Chainsaw]~n~~w~Mort ou Vif",2000,6);
	}
return 1;
}
Code:
forward changearme();
public changearme()
{
    foreach(Player, i)
    {
           ResetPlayerWeapons(i);
           GivePlayerWeapon(i, 9, 1);
           GameTextForPlayer(i, "WwX MOV ~r~[Chainsaw]~n~~w~Mort ou Vif",2000,6);
	}
return 1;
}
Try this once. And just use SetTimer.


Re: a idea for disarm all players and give all players ? - Saliim - 30.04.2016

i know for SetTimer, perfect it works thanks +1