[Tutorial] [SA:MP] Restore Health / Armor Command

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Apprentice Lukasas is offline
    MemberRank
    Oct 2008 Join Date
    18Posts

    [Tutorial] [SA:MP] Restore Health / Armor Command

    Hello =),

    i want to show you how to create command for restore health and armor it's so easy !.

    to OnPlayerCommandText:
    PHP Code:
    if(strcmp(cmd"/hpap"true) == 0){
    if(!
    IsPlayerAdmin(playerid)){ // check if player is admin
        
    SendClientMessage(playerid0xFF0000FF"You aren't admin.");
       return 
    1;
     }else{
        
    SetPlayerHealth(playerid100); // set player's hp to 100
        
    SetPlayerArmour(playerid100); // set player's armor to 100
        
    SendClientMessage(playerid0x00FF00FF"[-Admin-] Hp: **** Ap: 100 !");
        }
     return 
    1;

    that's all


  2. #2
    Apprentice anazhd is offline
    MemberRank
    Jul 2008 Join Date
    5Posts

    Re: [Tutorial] [SA-MP] Restore Health / Armor Command

    I need code for all user can use this.

  3. #3
    Enthusiast nowai! is offline
    MemberRank
    Jul 2009 Join Date
    Your moms roomLocation
    27Posts

    Re: [Tutorial] [SA-MP] Restore Health / Armor Command

    Quote Originally Posted by anazhd View Post
    I need code for all user can use this.
    Code:
    if(strcmp(cmd, "/healme", true) == 0){
    SetPlayerHealth(playerid,100);
    SetPlayerArmour(playerid,100);
    return 1;
    }
    Last edited by nowai!; 24-10-09 at 06:24 PM.

  4. #4
    Account Upgraded | Title Enabled! Worthy is offline
    MemberRank
    Apr 2008 Join Date
    ScotlandLocation
    256Posts

    Re: [Tutorial] [SA-MP] Restore Health / Armor Command

    Nice one.

    Maybe what you can do to improve it is to tell people what each line means or something?

  5. #5
    Apprentice nastykill12 is offline
    MemberRank
    Jun 2009 Join Date
    20Posts

    Re: [Tutorial] [SA-MP] Restore Health / Armor Command

    where i have to put it in?

    im new i have first server but i dont know how to script it in

  6. #6
    Novice WESTre is offline
    MemberRank
    Dec 2009 Join Date
    1Posts

    Re: [Tutorial] [SA-MP] Restore Health / Armor Command

    Quote Originally Posted by nastykill12 View Post
    where i have to put it in?

    im new i have first server but i dont know how to script it in
    Code:
    public OnPlayerCommandText(playerid, cmdtext[])
    {
    
    if(strcmp(cmd, "/healme", true) == 0)
    {
      
    SetPlayerHealth(playerid,100); // Sets the player health to 100. SetPlayerArmour(playerid,100); // Sets the player armor to 100. return 1; // Return 'true' OR '1' is used to notify the server that the command has successfully been processed.
    } return 0; }
    There you go.
    Last edited by WESTre; 07-12-09 at 04:27 PM.

  7. #7

    Re: [Tutorial] [SA-MP] Restore Health / Armor Command

    anyone can tell how to do this..? where to put this please.. i am newby in gta sa multiplayer :(

  8. #8
    Evil Scottish Overlord Junkers is offline
    LegendRank
    May 2007 Join Date
    United KingdomLocation
    8,216Posts

    Re: [Tutorial] [SA-MP] Restore Health / Armor Command

    Don't bump threads -.-'

  9. #9
    Apprentice cnnr155 is offline
    MemberRank
    Feb 2007 Join Date
    17Posts

    Re: [Tutorial] [SA-MP] Restore Health / Armor Command

    To heal all..
    Code:
    	if(strcmp(cmd,"/healall",true) == 0)
    	{
    	    for(new i = 0; i <= MAX_PLAYERS; i++)
    	    {
    	        SetPlayerHealth(i,100);
    	        SetPlayerArmour(i,100);
    		 }
    	}

  10. #10
    Account Upgraded | Title Enabled! Labbo is offline
    MemberRank
    Sep 2009 Join Date
    KL,MalaysiaLocation
    406Posts

    Re: [Tutorial] [SA-MP] Restore Health / Armor Command

    yeah, where do i have to put this code?

  11. #11
    Proficient Member coole9 is offline
    MemberRank
    Apr 2009 Join Date
    ..Location
    167Posts

    Re: [Tutorial] [SA-MP] Restore Health / Armor Command

    Are you kidding me? Get pawno. Add it to OnPlayerCommandText. Run you're server.

    I can tell mostly everyone here sucks at scripting if they haven't even looked at the SA-MP site WHICH HAS THE SERVER FILES IN THE DOWNLOADS SECTION AND A FORUM FOR BETTER HELP..

  12. #12
    Alpha Member bramdebouvere is offline
    MemberRank
    Aug 2006 Join Date
    BelgiumLocation
    2,409Posts

    Re: [Tutorial] [SA-MP] Restore Health / Armor Command

    Quote Originally Posted by coole9 View Post
    I can tell mostly everyone here sucks at scripting if they haven't even looked at the SA-MP site WHICH HAS THE SERVER FILES IN THE DOWNLOADS SECTION AND A FORUM FOR BETTER HELP..
    True, but not everyone has what it takes to be a good scripter..
    please don't advertise other forums ^_^

  13. #13
    Member cheezii is offline
    MemberRank
    Aug 2008 Join Date
    78Posts

    Re: [Tutorial] [SA-MP] Restore Health / Armor Command

    How to add it to a team if the gamemode have 2 teams?

  14. #14
    Alpha Member bramdebouvere is offline
    MemberRank
    Aug 2006 Join Date
    BelgiumLocation
    2,409Posts

    Re: [Tutorial] [SA-MP] Restore Health / Armor Command

    Quote Originally Posted by cheezii View Post
    How to add it to a team if the gamemode have 2 teams?
    I think you better make a new thread about this here: GTA:SA Multiplayer - RaGEZONE - MMORPG server development forums
    and please describe your problem better

  15. #15
    Software Engineer Evil[]Power is offline
    MemberRank
    Apr 2010 Join Date
    Look behind...Location
    1,191Posts

    Re: [Tutorial] [SA:MP] Restore Health / Armor Command

    where to find OnPlayerCommandText ?



Page 1 of 2 12 LastLast

Advertisement