PlayerWeapon Help
#1

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
Reply
#2

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"
Reply
#3

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.
Reply
#4

Quote:
Originally Posted by Lorenc_
Посмотреть сообщение
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"

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?
Reply
#5

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..
Reply
#6

any advice?
Reply
#7

- Delete, didn't see you want to give him the weapons back. -
Reply
#8

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);
Reply
#9

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?
Reply
#10

Use GetPlayerWeaponData to store all the weapons he had in a variable.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)