SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 12/08/2017, 12:47 PM   #11
Immortal99
Big Clucker
 
Immortal99's Avatar
 
Join Date: Mar 2016
Location: GetPlayerLocation
Posts: 129
Reputation: 5
Default Re: [PROBLEM] Armour and Health (MAX)

It looks like you putting this under another function or somethings wrong above in your script
__________________
Free & Paid SA-MP Servers

My Works
Immortal99 is offline   Reply With Quote
Old 12/08/2017, 12:53 PM   #12
spyro9696
Little Clucker
 
Join Date: Jan 2017
Posts: 35
Reputation: 1
Default Re: [PROBLEM] Armour and Health (MAX)

I resolved: I copied and pasted the message into pawno... I writed it manually and now it works.
Thanks.
spyro9696 is offline   Reply With Quote
Old 13/08/2017, 12:43 AM   #13
HoussamMaroc
Big Clucker
 
HoussamMaroc's Avatar
 
Join Date: Aug 2016
Location: Moroccan
Posts: 67
Reputation: 28
Default Re: [PROBLEM] Armour and Health (MAX)

I think this will fix your error
PHP Code:
COMMAND:armour(playeridparams[])
{
new 
id;
if (
sscanf(params"i"id))
return 
SendClientMessage(playerid0xFF0000AA"Usage: /armour <armour>");
If(
id 100)  return SendClientMessage(playerid0xFF0000AA"Usage: Max Armour Is 100");
SetPlayerArmour(playeridid);
// Do something
return 1;
}

COMMAND:health(playeridparams[])
{
new 
id;
if (
sscanf(params"i"id))
return 
SendClientMessage(playerid0xFF0000AA"Usage: /health <health>");
If(
id 100)  return SendClientMessage(playerid0xFF0000AA"Usage: Max Health Is 100");
SetPlayerHealth(playeridid);
// Do something
return 1;

HoussamMaroc is offline   Reply With Quote
Old 13/08/2017, 12:57 AM   #14
pabloalber84ban
Little Clucker
 
Join Date: Jun 2016
Posts: 35
Reputation: 0
Default Re: [PROBLEM] Armour and Health (MAX)

PHP Code:
COMMAND:armour(playeridparams[]) 

   
SetPlayerArmor(playerid100.0); 
   
SendClientMessageEx(playerid0x00FF00"Armour refilled."); 

// 
COMMAND:health(playeridparams[]) 

   
SetPlayerHealth(playerid100.0); 
   
SendClientMessageEx(playerid0x00FF00"Health refilled."); 

pabloalber84ban is offline   Reply With Quote
Old 13/08/2017, 05:54 AM   #15
KizZweLL
Little Clucker
 
KizZweLL's Avatar
 
Join Date: Jan 2016
Location: Philippines
Posts: 24
Reputation: 0
Default Re: [PROBLEM] Armour and Health (MAX)

Hello. If you want a command that will set a certain player's health when you type /health [ID]
here it is.

PHP Code:
CMD:health(playerid,params[])
{
      new 
id;
      if(
sscanf(params,"i",id)) return SendClientMessage(playerid,0xFF0000FF,"/health [ID]");
      
SetPlayerHealth(id,100);
      
SendClientMessage(id,-1,"Your health has been restored");
      return 
1;

But if you want to make a /health command without id NOTE: It will only restore your HP
here it is.

PHP Code:
CMD:health(playerid,params[])
{
       
SetPlayerHealth(playerid,100);
       return 
1;

If this solved your problem a thanks would be appreciated
if you want to do armour command just replace the Health to armour
__________________
Sometimes impossible can turn into reality.
KizZweLL is offline   Reply With Quote
Old 13/08/2017, 08:49 AM   #16
spyro9696
Little Clucker
 
Join Date: Jan 2017
Posts: 35
Reputation: 1
Default Re: [PROBLEM] Armour and Health (MAX)

I resolved, thank you very much!
spyro9696 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Health and armour problem DavidGravelli Scripting Help 2 14/06/2017 10:21 AM
Health and Armour Save Problem Kinto99 Scripting Help 6 27/03/2013 04:08 PM
Armour / Health problem Ananisiki Scripting Help 6 17/02/2013 02:43 AM
[HELP] Health and Armour for Admin PROBLEM c0GI Scripting Help 15 18/12/2011 09:43 PM
Health & Armour problem Torran Help Archive 12 23/02/2010 10:18 AM


All times are GMT. The time now is 05:48 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.