Any Solution?Problem :( - 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: Any Solution?Problem :( (
/showthread.php?tid=241076)
Any Solution?Problem :( -
Roomeo - 17.03.2011
I have Maded a /Medkit Command Which Get's 5000$ And Set Player's Health To 100 So this works but i want when the player health is 100 it says Your Health is Already Full/100.0. Well I've Tryed To Make this
pawn Код:
if (strcmp("/MedKit", cmdtext, true, 8) == 0)
{
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFF0000AA, " You dont have enough money!");
if(GetPlayerHealth(playerid) < 100) return SendClientMessage(playerid, 0xFF0000AA, "Your Health Is Already Full!");
{
GivePlayerMoney(playerid, -5000);
SetPlayerHealth(playerid,100);
}
return 1;
}
But This Error
pawn Код:
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\MyScript.pwn(1737) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Warning.
Re: Any Solution?Problem :( -
gamer931215 - 17.03.2011
pawn Код:
if (strcmp("/MedKit", cmdtext, true, 8) == 0)
{
new Float:health;GetPlayerHealth(playerid,health);
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFF0000AA, " You dont have enough money!");
if(health > 99) return SendClientMessage(playerid, 0xFF0000AA, "Your Health Is Already Full!");
{
GivePlayerMoney(playerid, -5000);
SetPlayerHealth(playerid,100);
}
return 1;
}
Re: Any Solution?Problem :( -
Roomeo - 17.03.2011
Quote:
Originally Posted by gamer931215
pawn Код:
if (strcmp("/MedKit", cmdtext, true, 8) == 0) { new Float:health;GetPlayerHealth(playerid,health); if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFF0000AA, " You dont have enough money!"); if(health < 100) return SendClientMessage(playerid, 0xFF0000AA, "Your Health Is Already Full!"); { GivePlayerMoney(playerid, -5000); SetPlayerHealth(playerid,100); } return 1; }
|
Thanks
EDIT: It's Still Getting Money.... and Don't Say Your Health is Already Full
Re: Any Solution?Problem :( -
gamer931215 - 17.03.2011
Quote:
Originally Posted by Roomeo
EDIT: It's Still Getting Money.... and Don't Say Your Health is Already Full 
|
What do you mean exactly ? are you sure you also changed "if(health > 99)" ?
Re: Any Solution?Problem :( -
Roomeo - 17.03.2011
Well i want if my health is 100 it don't get money and say your health is already 100
pawn Код:
if (strcmp("/MedKit", cmdtext, true, 8) == 0)
{
new Float:health;GetPlayerHealth(playerid,health);
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFF0000AA, " You dont have enough money!");
if(health < 100) return SendClientMessage(playerid, 0xFF0000AA, "Your Health Is Already Full!");
{
GivePlayerMoney(playerid, -5000);
SetPlayerHealth(playerid,100);
}
return 1;
}
it Don''t says your health..... and get the money
Re: Any Solution?Problem :( -
gamer931215 - 17.03.2011
Quote:
Originally Posted by Roomeo
Well i want if my health is 100 it don't get money and say your health is already 100
pawn Код:
if (strcmp("/MedKit", cmdtext, true, 8) == 0) { new Float:health;GetPlayerHealth(playerid,health); if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFF0000AA, " You dont have enough money!"); if(health < 100) return SendClientMessage(playerid, 0xFF0000AA, "Your Health Is Already Full!"); { GivePlayerMoney(playerid, -5000); SetPlayerHealth(playerid,100); } return 1; }
it Don''t says your health..... and get the money
|
Well yes, you have this:
pawn Код:
if(health < 100) return SendClientMessage(playerid, 0xFF0000AA, "Your Health Is Already Full!");
This equals to "Is less as", so you are actually using "If the player health is less as 100, stop the command and return the message".
You should use this instead:
pawn Код:
if(health > 99) return SendClientMessage(playerid, 0xFF0000AA, "Your Health Is Already Full!");
This means if the health is above 99 (so if its 100 or above, aka when the health is full), THEN return the message.
Re: Any Solution?Problem :( -
Roomeo - 17.03.2011
oh Thanks