onplayerdeath
#1

Okay well i want that if player is ON adminduty
That when he dies or spawns he gets his weapons returned
I got this

pawn Код:
if(PlayerInfo[playerid][Adminduty] == 1)    {
         return GivePlayerWeapon(playerid,38,cellmax);
         return SetPlayerColor(playerid, 0xFF00A8FF);
         return SetPlayerHealth(playerid,100000);
         }
Reply
#2

This will work.
pawn Код:
if(PlayerInfo[playerid][Adminduty] == 1)    {
         GivePlayerWeapon(playerid,38,cellmax);
         SetPlayerColor(playerid, 0xFF00A8FF);
         SetPlayerHealth(playerid,100000);
         return true;
         }
Reply
#3

Didn't work
Reply
#4

Cellmax is a valid global integer variable? Which stores the value of the players ammo? If that so , it will work. Else it wont.

How are you storing the value of the ammo he had before dying?
Reply
#5

Quote:
Originally Posted by ******
Посмотреть сообщение
cellmax is a compiler in built constant with a value of 2147483647.

Where is that code called?
Fuck! Really? What is it used for then?

This code had it.
pawn Код:
GivePlayerWeapon(playerid,38,cellmax);
Reply
#6

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
Fuck! Really? What is it used for then?

This code had it.
pawn Код:
GivePlayerWeapon(playerid,38,cellmax);
He just wanted to give the player the highest possible positive number which is cellmax (2 ^ 31 - 1)
But if I remember correctly the ammo can only go up to 2 ^ 16 - 1 (65535)
Reply
#7

So ontopic again?
Reply
#8

Quote:
Originally Posted by ******
Посмотреть сообщение
It's used for a large number, that's it. And yes really - clearly you haven't read pawn-lang.pdf in a while.
Okay Cool. Yeah i have not read it. I must. I might read it in some as you have stated it clearly. Thanks for the suggestion Mr. Alex Cole.

Quote:
Originally Posted by Biess
Посмотреть сообщение
So ontopic again?
I think that code will work , isnt it guys?

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
He just wanted to give the player the highest possible positive number which is cellmax (2 ^ 31 - 1)
But if I remember correctly the ammo can only go up to 2 ^ 16 - 1 (65535)
Maybe thats why it doesnt work. Biess Change cellmax to 65535 then and try it out.
Reply
#9

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
Okay Cool. Yeah i have not read it. I must. I might read it in some as you have stated it clearly. Thanks for the suggestion Mr. Alex Cole.



I think that code will work , isnt it guys?



Maybe thats why it doesnt work. Biess Change cellmax to 65535 then and try it out.
But it doesnt even give skins?
Reply
#10

Quote:
Originally Posted by Biess
Посмотреть сообщение
But it doesnt even give skins?
pawn Код:
if(PlayerInfo[playerid][Adminduty] == 1)    {
         GivePlayerWeapon(playerid,38,cellmax);
         SetPlayerColor(playerid, 0xFF00A8FF);
         SetPlayerHealth(playerid,100000);
         SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]); // Change PlayerInfo thing to a number or Skin id
         return true;
         }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)