5 errors for a 10 letter line??
#1

Heres the code... Im not sure if i did It right...

Код:
SetPlayerHealth(playerid, += 15);
Heres the errors....

Код:
C:\Users\Lachlan\Desktop\Hosting Server\pawno\iGRP.pwn(7899) : error 029: invalid expression, assumed zero
C:\Users\Lachlan\Desktop\Hosting Server\pawno\iGRP.pwn(7899) : warning 215: expression has no effect
C:\Users\Lachlan\Desktop\Hosting Server\pawno\iGRP.pwn(7899) : error 001: expected token: ";", but found ")"
C:\Users\Lachlan\Desktop\Hosting Server\pawno\iGRP.pwn(7899) : error 029: invalid expression, assumed zero
C:\Users\Lachlan\Desktop\Hosting Server\pawno\iGRP.pwn(7899) : fatal error 107: too many error messages on one line
Help Pl0X !!

Reply
#2

pawn Код:
SetPlayerHealth(playerid, GetPlayerHealth(playerid)+15);
Reply
#3

Код:
new Float:health;
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, health+15.0);
Reply
#4

If you would make an incudefile with a function like this in it, it would be a lot easier:
pawn Код:
stock GivePlayerHealth(playerid, ammount)
{
    new Float:phealth;
    GetPlayerHealth(playerid, phealth);
    SetPlayerHealth(playerid, phealth + ammount);
    return 1;
}
Then you could use
pawn Код:
GivePlayerHealth(playerid, 15);
and finished!

Just a suggestion
Reply
#5

Cool denis! Thanks, and

Thanks jeff it worked, but now from my food menu, this error appears

Код:
C:\Users\Lachlan\Desktop\Hosting Server\pawno\iGRP.pwn(24077) : warning 219: local variable "drink" shadows a variable at a preceding level
C:\Users\Lachlan\Desktop\Hosting Server\pawno\iGRP.pwn(28976) : warning 203: symbol is never used: "EatMenu"
Reply
#6

Okay I fixed the EatMenu error...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)