Need a little advice.
#1

Ok since i have now GetPlayerWeaponData at OnPlayerDeath, when i just simply do GivePlayerWeapon
under OnPlayerSpawn(or any other methods like at AddPlayerClass),
the player respawns with double the ammo he had before(i know its logical)
GivePlayerWeapon doesnt works at OnPlayerConnect anymore for some reason(i remeber it worked at 0.3a)
So i need some ideas how to give the player weapons that he wont become when
he respawns only the weapons that getplayerweapondata stored at players death.
Ive already tryed SetSpawnInfo with weapons at OnPlayerRequestClass and
SetSpawnInfo without weapons under onplayerdeath but no sussces.

I hope you guys catch me, if not i will tell this straight:

Player goes on the server, recives some weapons like at onplayerconnect(he doesnt respawns with them again)
he dies, here comes GetPlayerWeaponData, playerrespawns, gets the weps from getplayerweapondata


Please need some good ideas how to make this.
Regards.
Reply
#2

Wow confusing, this wouldn't be a proper solution but just give them half the ammo that you wan't them to have so it doubles to the amount you want.
Reply
#3

Why does it give them the double of the ammo the had before?
Reply
#4

Quote:
Originally Posted by Miguel
Посмотреть сообщение
Why does it give them the double of the ammo the had before?
because i have GetPlayerWeaponData function at OnPlayerDeath, its important so the players wont
loose theyre weapons, it gives them the double ammo because they recive weapons from the
spawn(AddPlayerClass(0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0);+the weapons that GetPlayerWeaponData stored the the previous weapons....
Men if i could somehow make the GivePlayerWeapon function work at OnPlayerConnect,
the problem would be solved :/
Reply
#5

Before the GivePlayerWeapon thing put ResetPlayerWeapons, or show code so we can help you better.
Reply
#6

i cant do that, because when i do ResetPlayerWeapons at OnPlayerSpawn the players who
connect wont recive any weapons and when i put that under OnPlayerDeath,
yeah i also thoud it executes the functions at the rank of the lines but it doesnt...
As i said if it would work at OnPlayerConnect that the weapons woud not come back again, then it would be fine..
Reply
#7

Show your code then.

Or make a variable like PlayerNotSpawnedYet and when they spawn for first time you give him the weapons, then you check again, and if he is already spawned you use ResetPlayerWeapons.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)