Save Weapons when /q +REP
#1

Does anyone know how to make it so that it saves a players weapons and ammo when they exit the server but when they get killed or die, they lose everything? I'm using ZCMD.
Reply
#2

What system are you using to save a player's stats?
Reply
#3

Under onPlayerDeath()
ResetPlayerWeapons(playerid)
Reply
#4

You should try editing the mod with adding some weapon lines on user.cfg creation.
Reply
#5

No comment.
Reply
#6

wait so how do I do it?
Reply
#7

Go to public OnPlayerDeath()
and under that, put ResetPlayerWeapons(playerid);
Reply
#8

To reset weapons on death you would add this under OnPlayerDeath.
So it would end up looking something like this.
pawn Код:
public OnPlayerDeath(playerid,killerid)
{
    ResetPlayerWeapons(playerid);
    // rest of your code here
    return 1;
}
About saving guns when a player logs off, we need to know what saving system you are using (if you even have one).
Reply
#9

Quote:
Originally Posted by Jack.7331
Посмотреть сообщение
Go to public OnPlayerDeath()
and under that, put ResetPlayerWeapons(playerid);
Okay thanks but that's only on player death. How can I save the weapons when the player disconnects.
Reply
#10

Quote:
Originally Posted by TheMightyEddy
Посмотреть сообщение
Does anyone know how to make it so that it saves a players weapons and ammo when they exit the server but when they get killed or die, they lose everything? I'm using ZCMD.
So from your thinking you're gunna make a command "/Quit"\"/Q" And Then when player types that it saves guns for him?

That's weird, Save guns onplayerdisconnect.
We don't know what .ini you are using.

Is it dini, fini, y_ini or something else? (name it)

They lose guns normally on death, Just set the variables of gun and ammo to 0.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)