[PROBLEM] Armour and Health (MAX) -
spyro9696 - 12.08.2017
Hello, I have another problem... I don't know how to set directly to the maximum health and armour.
When I type /health and /armour, it don't set me the max health and armour, but it requires a number.
Ex: /health 100
So, is it possible set your health and armour directly to the maximum typing /health and /armour?
This is the code:
Quote:
COMMAND:armour(playerid, params[])
{
new id;
if (sscanf(params, "i", id))
return SendClientMessage(playerid, 0xFF0000AA, "Usage: /armour <armour>");
SetPlayerArmour(playerid, id);
// Do something
return 1;
}
COMMAND:health(playerid, params[])
{
new id;
if (sscanf(params, "i", id))
return SendClientMessage(playerid, 0xFF0000AA, "Usage: /health <health>");
SetPlayerHealth(playerid, id);
// Do something
return 1;
}
|
Re: [PROBLEM] Armour and Health (MAX) -
Zeth - 12.08.2017
Yes it is possible.
Check this out:
Quote:
COMMAND:armour(playerid, params[])
{
//new id;
//if (sscanf(params, "i", id))
//return SendClientMessage(playerid, 0xFF0000AA, "Usage: /armour <armour>");
SetPlayerArmour(playerid, 100);
// Do something
return 1;
}
COMMAND:health(playerid, params[])
{
//new id;
//if (sscanf(params, "i", id))
//return SendClientMessage(playerid, 0xFF0000AA, "Usage: /health <health>");
SetPlayerHealth(playerid, 100);
// Do something
return 1;
}
|
Re: [PROBLEM] Armour and Health (MAX) -
JaKe Elite - 12.08.2017
PHP код:
COMMAND:armour(playerid, params[])
{
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid, -1, "Armour refilled.");
return 1;
}
COMMAND:health(playerid, params[])
{
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, -1, "Health refilled.");
return 1;
}
Re: [PROBLEM] Armour and Health (MAX) -
Zeth - 12.08.2017
Quote:
Originally Posted by JaKe Elite
PHP код:
COMMAND:armour(playerid, params[])
{
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid, -1, "Armour refilled.");
return 1;
}
COMMAND:health(playerid, params[])
{
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, -1, "Health refilled.");
return 1;
}
|
That is what i said above.
Re: [PROBLEM] Armour and Health (MAX) -
spyro9696 - 12.08.2017
Quote:
Originally Posted by JaKe Elite
PHP код:
COMMAND:armour(playerid, params[])
{
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid, -1, "Armour refilled.");
return 1;
}
COMMAND:health(playerid, params[])
{
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, -1, "Health refilled.");
return 1;
}
|
Jake, when I compile, it gives me these errors
Re: [PROBLEM] Armour and Health (MAX) - Astralis - 12.08.2017
Remove ,params[] on each command.
Re: [PROBLEM] Armour and Health (MAX) -
spyro9696 - 12.08.2017
Quote:
Originally Posted by Astralis
Remove ,params[] on each command.
|
Ok, but now there are errors only in line 476
Re: [PROBLEM] Armour and Health (MAX) -
GuilhermeNunes - 12.08.2017
PHP код:
CMD:life(playerid)
{
SetPlayerHealth(playerid, 100);
return 1;
}
PHP код:
CMD:armour(playerid)
{
SetPlayerArmour(playerid,100);
return 1;
}
Put in your Code
Re: [PROBLEM] Armour and Health (MAX) -
Qbao - 12.08.2017
Did you try this command?
PHP код:
COMMAND:armour(playerid, params[])
{
SetPlayerArmor(playerid, 100);
SendClientMessageEx(playerid, 0x00FF00, "Armour refilled.");
}
//
COMMAND:health(playerid, params[])
{
SetPlayerHealth(playerid, 100);
SendClientMessageEx(playerid, 0x00FF00, "Health refilled.");
}
Re: [PROBLEM] Armour and Health (MAX) -
spyro9696 - 12.08.2017
nothing... errors, errors, errors....