I need some help..
#1

is it possible to make a /reload command to reload your weapons?
Reply
#2

Yes, you can make a reload command and use

pawn Code:
if(GetPlayerWeapon(playerid) == 38)
{
     GivePlayerWeapon(playerid, 38, 0);
     GivePlayerWeapon(playerid, 38, 100); /* this will inevitably reset the weapon ID 38 and give him
100 ammo so the command can't be abused and he can keep getting ammo */

}
if(GetPlayerWeapon(playerid) == 20) // and then continue to do this...
{
     GivePlayerWeapon(playerid, 20, 0);
     GivePlayerWeapon(playerid, 20, 100);
}
Reply
#3

so i can do
Code:
if(GetPlayerWeapon(playerid) == 22)
{
     GivePlayerWeapon(playerid, 22, 0);
     GivePlayerWeapon(playerid, PlayerInfo[playerid][pWep2a]); //ammo
}
Reply
#4

Yes, give it a go.

Edit: As Konstantinos said, I forgot.

You need to do:

pawn Code:
GivePlayerWeapon(playerid, weaponid, PlayerInfo[playerid][pWep2a]);
Instead of:

pawn Code:
GivePlayerWeapon(playerid, PlayerInfo[playerid][pWep2a]);
Obviously, weaponid being the weaponid which is an number.
Reply
#5

Don't forget the GivePlayerWeapon function has 3 parameters.

playerid
weaponid
ammo


In the above example of you, you have 2 parameters only and that will give you a warning.
Reply
#6

Thanks guys you gave me the idea of using timers and stuff.. (Like when u press 'r' you will get 0 ammo and it will send you a client message 'reloading'.. (Or a gametext) and you will have to wait 3 sec and then you will get your ammo back
Reply
#7

Quote:
Originally Posted by sansk
View Post
Thanks guys �� you gave me the idea of using timers and stuff.. (Like when u press 'r' you will get 0 ammo and it will send you a client message 'reloading'.. (Or a gametext) and you will have to wait 3 sec and then you will get your ammo back
That's a great idea, good thinking .
Reply
#8

Do you know if There is a reload animation?
Reply
#9

Yes there is.

Go here: https://sampwiki.blast.hk/wiki/Animations

Press CONTROL+F and type 'reload', just flick through the different ones.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)