PlayerWeapon Help - 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: PlayerWeapon Help (
/showthread.php?tid=163861)
PlayerWeapon Help -
Kevin_Joshen - 29.07.2010
Hey there! Listen, i need to know how to get a players weapons info (what weapons they have, and how much of each) i need to be able to store it and then give it back to them in a situation like this;
1. player type /mp5
2. the player gets 500 mp5 bullets
3. the player types /minigundm
4. The player will go to the minigun dm and have no weapons but a minigun
5. upon the player exiting the DM he needs to lose the minigun, and get the weapons that he had before he joined back.
Please Help!!
-Kevin
Re: PlayerWeapon Help -
Lorenc_ - 29.07.2010
Use these links:
https://sampwiki.blast.hk/wiki/ResetPlayerWeapons
https://sampwiki.blast.hk/wiki/GivePlayerWeapon
Those should be fine for what your looking for
"Dm leaves they loose their minigun"
Re: PlayerWeapon Help -
[MWR]Blood - 29.07.2010
pawn Код:
//Under OnPlayerCommandText
if(strcmp(cmdtext,"/mp5",true)==0)
{
GivePlayerWeapon(playerid,29,500);
return 1;
}
if(strcmp(cmdtext,"/minigundm,true)==0)
{
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,38,150000);
return 1;
}
That's from me, for get the weapons back when he's leaving a DM you should make another command, which is not so short I guess.
Use this -
https://sampforum.blast.hk/showthread.php?tid=118885 to request your scripts.
Re: PlayerWeapon Help -
Kevin_Joshen - 29.07.2010
Quote:
Originally Posted by Lorenc_
|
i've already read the samp wiki and stuff. do you think you could give an example of how the coding should look or something?
Re: PlayerWeapon Help -
Kevin_Joshen - 29.07.2010
Quote:
Originally Posted by ikarus
pawn Код:
//Under OnPlayerCommandText if(strcmp(cmdtext,"/mp5",true)==0) { GivePlayerWeapon(playerid,29,500); return 1; } if(strcmp(cmdtext,"/minigundm,true)==0) { ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid,38,150000); return 1; }
That's from me, for get the weapons back when he's leaving a DM you should make another command, which is not so short I guess.
Use this - https://sampforum.blast.hk/showthread.php?tid=118885 to request your scripts.
|
thats like what im using now... but then when the guy exits minigun dm and goes to lsair, he now has a minigun..
Re: PlayerWeapon Help -
Kevin_Joshen - 29.07.2010
any advice?
Re: PlayerWeapon Help -
XtremePlanet - 29.07.2010
- Delete, didn't see you want to give him the weapons back. -
Re: PlayerWeapon Help -
[MWR]Blood - 29.07.2010
Quote:
Originally Posted by Kevin_Joshen
thats like what im using now... but then when the guy exits minigun dm and goes to lsair, he now has a minigun..
|
Put under OnPlayerCommendText:
pawn Код:
ResetPlayerWeapons(playerid);
Re: PlayerWeapon Help -
Kevin_Joshen - 29.07.2010
Quote:
Originally Posted by ikarus
Put under OnPlayerCommendText:
pawn Код:
ResetPlayerWeapons(playerid);
|
omfg! I know! that's what i've been doing. But how do i get rid of the minigun and give him back the gun he had before going into the DM?
Re: PlayerWeapon Help -
Vince - 29.07.2010
Use GetPlayerWeaponData to store all the weapons he had in a variable.