onplayerdeath - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: onplayerdeath (
/showthread.php?tid=347822)
onplayerdeath -
Biess - 03.06.2012
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);
}
Re: onplayerdeath -
Ballu Miaa - 03.06.2012
This will work.
pawn Код:
if(PlayerInfo[playerid][Adminduty] == 1) {
GivePlayerWeapon(playerid,38,cellmax);
SetPlayerColor(playerid, 0xFF00A8FF);
SetPlayerHealth(playerid,100000);
return true;
}
Re: onplayerdeath -
Biess - 03.06.2012
Didn't work
Re: onplayerdeath -
Ballu Miaa - 03.06.2012
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?
Re: onplayerdeath -
Ballu Miaa - 03.06.2012
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);
AW: Re: onplayerdeath -
Nero_3D - 03.06.2012
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)
Re: onplayerdeath -
Biess - 03.06.2012
So ontopic again?
Re: onplayerdeath -
Ballu Miaa - 03.06.2012
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.
Re: onplayerdeath -
Biess - 03.06.2012
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?
Re: onplayerdeath -
Ballu Miaa - 04.06.2012
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;
}