SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 30/04/2016, 04:44 PM   #1
Saliim
Big Clucker
 
Saliim's Avatar
 
Join Date: Mar 2016
Location: France
Posts: 99
Reputation: 6
Default a idea for disarm all players and give all players ?

Hi, you have a idea for disarm all players, after idea for give weapons for all players
__________________
Si tu aime quand ça pète de partout viens ici
If you like it when it explodes all over come here
Si te gusta, cuando explota todo venir aquí

51.254.29.46:30465

Saliim is offline   Reply With Quote
Old 30/04/2016, 04:48 PM   #2
oMa37
Gangsta
 
Join Date: Feb 2016
Posts: 968
Reputation: 155
Default Re: a idea for disarm all players and give all players ?

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

oMa37 is offline   Reply With Quote
Old 30/04/2016, 04:50 PM   #3
CalvinC
High-roller
 
CalvinC's Avatar
 
Join Date: Nov 2014
Location: Denmark
Posts: 1,831
Reputation: 114
Default Re: a idea for disarm all players and give all players ?

Loop
ResetPlayerWeapons
GivePlayerWeapon
__________________
[Tutorial] Custom Playerdamage system
Desert Eagle's dealing too much damage, you want one-hit sniper kills, or damage based on body parts? Check this out.
CalvinC is offline   Reply With Quote
Old 30/04/2016, 04:51 PM   #4
Saliim
Big Clucker
 
Saliim's Avatar
 
Join Date: Mar 2016
Location: France
Posts: 99
Reputation: 6
Default Re: a idea for disarm all players and give all players ?

thanks all
__________________
Si tu aime quand ça pète de partout viens ici
If you like it when it explodes all over come here
Si te gusta, cuando explota todo venir aquí

51.254.29.46:30465

Saliim is offline   Reply With Quote
Old 30/04/2016, 04:53 PM   #5
MBilal
Gangsta
 
MBilal's Avatar
 
Join Date: May 2013
Posts: 811
Reputation: 57
Default Re: a idea for disarm all players and give all players ?

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);
		   }
	    }
 
}
MBilal is offline   Reply With Quote
Old 30/04/2016, 05:02 PM   #6
Saliim
Big Clucker
 
Saliim's Avatar
 
Join Date: Mar 2016
Location: France
Posts: 99
Reputation: 6
Default Re: a idea for disarm all players and give all players ?

i don't wan't a commande ^^, i wan't only a idea for disarm all players, and give weapon for all players
__________________
Si tu aime quand ça pète de partout viens ici
If you like it when it explodes all over come here
Si te gusta, cuando explota todo venir aquí

51.254.29.46:30465

Saliim is offline   Reply With Quote
Old 30/04/2016, 05:28 PM   #7
Saliim
Big Clucker
 
Saliim's Avatar
 
Join Date: Mar 2016
Location: France
Posts: 99
Reputation: 6
Default Re: a idea for disarm all players and give all players ?

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;
}
__________________
Si tu aime quand ça pète de partout viens ici
If you like it when it explodes all over come here
Si te gusta, cuando explota todo venir aquí

51.254.29.46:30465

Saliim is offline   Reply With Quote
Old 30/04/2016, 06:00 PM   #8
oMa37
Gangsta
 
Join Date: Feb 2016
Posts: 968
Reputation: 155
Default Re: a idea for disarm all players and give all players ?

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
oMa37 is offline   Reply With Quote
Old 30/04/2016, 06:36 PM   #9
Saliim
Big Clucker
 
Saliim's Avatar
 
Join Date: Mar 2016
Location: France
Posts: 99
Reputation: 6
Default Re: a idea for disarm all players and give all players ?

how :/
__________________
Si tu aime quand ça pète de partout viens ici
If you like it when it explodes all over come here
Si te gusta, cuando explota todo venir aquí

51.254.29.46:30465

Saliim is offline   Reply With Quote
Old 30/04/2016, 06:45 PM   #10
Ritzy2K
High-roller
 
Ritzy2K's Avatar
 
Join Date: Jun 2014
Location: India
Posts: 1,548
Reputation: 170
Default Re: a idea for disarm all players and give all players ?

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.
__________________
Ritzy2K is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Give all players a car? Eminem 2ka9 Scripting Help 5 05/03/2013 06:53 PM
/give gun [FOR PLAYERS] Smacky Scripting Help 2 18/09/2012 04:52 PM
Disarm players on login ColdIce Help Archive 9 11/07/2011 09:09 AM
Give all players SampStunta Help Archive 5 13/09/2010 11:19 AM


All times are GMT. The time now is 12:35 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.