Give health when write cmds
#1

I tryed some scripts with SetPlayerHealth();

Well, i want a script when you write /eat you get 20 health.
Now i have:
Код:
        if(!strcmp("/eat", cmdtext,true))
    {
        if(!IsPlayerInRangeOfPoint(playerid, 2.0, 240.1804,1117.3380,1080.9922))return SendClientMessage(playerid, COLOR_WHITE,"You are not in /eat checkpoint");
        {
		SetPlayerHealth(playerid...???);
            return 1;
        }
Reply
#2

Quote:
Originally Posted by nejc001
Посмотреть сообщение
I tryed some scripts with SetPlayerHealth();

Well, i want a script when you write /eat you get 20 health.
Now i have:
Код:
        if(!strcmp("/eat", cmdtext,true))
    {
        if(!IsPlayerInRangeOfPoint(playerid, 2.0, 240.1804,1117.3380,1080.9922))return SendClientMessage(playerid, COLOR_WHITE,"You are not in /eat checkpoint");
        {
		SetPlayerHealth(playerid...???);
            return 1;
        }
pawn Код:
if(!strcmp("/eat", cmdtext,true))
    {
        if(!IsPlayerInRangeOfPoint(playerid, 2.0, 240.1804,1117.3380,1080.9922))return SendClientMessage(playerid, COLOR_WHITE,"You are not in /eat checkpoint");
        {
        SetPlayerHealth(playerid,GetPlayerHealth(playerid)+20);
            return 1;
        }
Reply
#3

Yes i tryed that allready but i get a *warning 202: number of arguments does not match definition*
:/
Reply
#4

Quote:
Originally Posted by nejc001
Посмотреть сообщение
Код:
SetPlayerHealth(playerid...???);
https://sampwiki.blast.hk/wiki/SetPlayerHealth
https://sampwiki.blast.hk/wiki/GetPlayerHealth
pawn Код:
new Float:health;
GetPlayerHealth(playerid,health);
SetPlayerHealth(playerid, health+20);
Reply
#5

works, ty
Reply
#6

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/SetPlayerHealth
https://sampwiki.blast.hk/wiki/GetPlayerHealth
pawn Код:
new Float:health;
GetPlayerHealth(playerid,health);
SetPlayerHealth(playerid, health+20);
Lol, i made this mistake before, I will never learn it xD
Reply
#7

Quote:
Originally Posted by DeathOnaStick
Посмотреть сообщение
Lol, i made this mistake before, I will never learn it xD
I do it all the time too x)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)