getplayerhealth - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: getplayerhealth (
/showthread.php?tid=268377)
getplayerhealth -
Horrible - 12.07.2011
pawn Код:
CMD:stunt(playerid, params[])
{
new name[24], string[56];
new Float:armour;
GetPlayerArmour(playerid, armour);
GetPlayerHealth(playerid,health);
SetPlayerHealth(playerid,100000);
SetPlayerArmour(playerid,100000);
CMD:dm(playerid, params[])
{
new name[24], string[56];
new Float:armour;
SetPlayerArmour(playerid, armour);
SetPlayerHealth(playerid,health);
but it not works when u type /dm (from stunt) u got 0 health
^pl0x help....
Re: getplayerhealth -
Edvin - 12.07.2011
pawn Код:
new Float:armour, Float:health;
put this instead of
and try it...
Re: getplayerhealth -
Horrible - 12.07.2011
not works...
pl0X
Re: getplayerhealth -
Roko_foko - 12.07.2011
pawn Код:
new Float:gArmour[MAX_PLAYERS];// add this two lines near your global variables declaration(under one of your enums).
new Float:gHealth[MAX_PLAYERS];
CMD:stunt(playerid, params[])
{
new name[24], string[56];
GetPlayerArmour(playerid, gArmour[playerid]);
GetPlayerHealth(playerid, gHealth[playerid]);
SetPlayerHealth(playerid,100000);
SetPlayerArmour(playerid,100000);
CMD:dm(playerid, params[])
{
new name[24], string[56];
SetPlayerArmour(playerid, gArmour[playerid]);
SetPlayerHealth(playerid, gHealth[playerid]);
This should work.
Re: getplayerhealth -
Horrible - 12.07.2011
Quote:
Originally Posted by Roko_foko
pawn Код:
new Float:gArmour[MAX_PLAYERS];// add this two lines near your global variables declaration(under one of your enums). new Float:gHealth[MAX_PLAYERS];
CMD:stunt(playerid, params[]) { new name[24], string[56]; GetPlayerArmour(playerid, gArmour[playerid]); GetPlayerHealth(playerid, gHealth[playerid]); SetPlayerHealth(playerid,100000); SetPlayerArmour(playerid,100000);
CMD:dm(playerid, params[]) { new name[24], string[56]; SetPlayerArmour(playerid, gArmour[playerid]); SetPlayerHealth(playerid, gHealth[playerid]);
This should work.
|
TY man!