Health.
#1

Hi i have problem here:

Код:
SetPlayerHealth(playerid,GetPlayerHealth(playerid)+5);
SetPlayerHealth(issuerid,GetPlayerHealth(playerid)-5);
Why i get errors?

Код:
C:\Program Files\Samp serveriai\NAUJAUSIAS SAMP SERVERIS\gamemodes\freeroam.pwn(2103) : warning 202: number of arguments does not match definition
C:\Program Files\Samp serveriai\NAUJAUSIAS SAMP SERVERIS\gamemodes\freeroam.pwn(2104) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Reply
#2

pawn Код:
new Float:hp;
SetPlayerHealth(playerid,GetPlayerHealth(playerid, hp) + 5);
SetPlayerHealth(issuerid,GetPlayerHealth(playerid, hp) - 5);
Try this
Reply
#3

Quote:
Originally Posted by kizla
Посмотреть сообщение
pawn Код:
new Float:hp;
SetPlayerHealth(playerid,GetPlayerHealth(playerid, hp) + 5);
SetPlayerHealth(issuerid,GetPlayerHealth(playerid, hp) - 5);
Try this
What?

pawn Код:
new Float:Health;
GetPlayerHealth(playerid, Health);
SetPlayerHealth(playerid, Health + 5);
GetPlayerHealth(issuerid, Health);
SetPlayerHealth(issuerid, Health + 5);
Reply
#4

my works fine too..
Reply
#5

pawn Код:
stock HP(playerid)
{
    new Float:Health; //Creates our float so we can store the health in it
    GetPlayerHealth(playerid, Health); //Get's their health storing it in our float
    return floatround(Health); //Rounds off the float to make it a regular number then returns that
}
Then you'd just
pawn Код:
SetPlayerHealth(playerid, HP(playerid)+5);

This however isn't tested..but should work I believe

EDIT: I misread names - sorry :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)