Give health when write cmds - 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: Give health when write cmds (
/showthread.php?tid=176292)
Give health when write cmds -
nejc001 - 12.09.2010
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;
}
Re: Give health when write cmds -
DeathOnaStick - 12.09.2010
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;
}
Re: Give health when write cmds -
nejc001 - 12.09.2010
Yes i tryed that allready but i get a *warning 202: number of arguments does not match definition*
:/
Re: Give health when write cmds -
Cameltoe - 12.09.2010
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);
Re: Give health when write cmds -
nejc001 - 12.09.2010
works, ty
Re: Give health when write cmds -
DeathOnaStick - 12.09.2010
Quote:
Originally Posted by Cameltoe
|
Lol, i made this mistake before, I will never learn it xD
Re: Give health when write cmds -
Cameltoe - 12.09.2010
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)