SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 18/06/2019, 06:13 PM   #1
alvin6
Little Clucker
 
Join Date: Mar 2017
Posts: 38
Reputation: 2
Thumbs up How to make command to give player armour

Hello,
I'm beginner/newbie and looking for someone to make filterscript for me like when player type /hparmour so his health and armour get replenish

thanks
alvin6 is offline   Reply With Quote
Old 18/06/2019, 06:23 PM   #2
Fuzzy
Little Clucker
 
Join Date: May 2019
Posts: 29
Reputation: 0
Default Re: How to make command to give player armour

Code:
CMD:setarmor(playerid, params[])
{
	static
		userid,
	    Float:amount;

	if (PlayerData[playerid][pAdmin] < 3)
	    return SendErrorMessage(playerid, "You don't have permission to use this command.");

	if (sscanf(params, "uf", userid, amount))
		return SendSyntaxMessage(playerid, "/setarmor [playerid/name] [amount]");

	if (userid == INVALID_PLAYER_ID)
	    return SendErrorMessage(playerid, "You have specified an invalid player.");

    SetPlayerArmour(userid, amount);
	SendAdminAction(playerid, "You have set %s's armour to %.2f.", ReturnName(userid, 0), amount);
	SendAdminAction(userid, "Administrator %s has set your armour to %.2f.", ReturnName(playerid, 0), amount);
	return 1;
}

CMD:sethealth(playerid, params[])
{
	static
		userid,
	    Float:amount;

	if (PlayerData[playerid][pAdmin] < 1)
	    return SendErrorMessage(playerid, "You don't have permission to use this command.");

	if (sscanf(params, "uf", userid, amount))
		return SendSyntaxMessage(playerid, "/sethealth [playerid/name] [amount]");

	if (userid == INVALID_PLAYER_ID)
	    return SendErrorMessage(playerid, "You have specified an invalid player.");

	SetPlayerHealth(userid, amount);
	SendAdminAction(playerid, "You have set %s's health to %.2f.", ReturnName(userid, 0), amount);
	SendAdminAction(userid, "Administrator %s has set your health to %.2f.", ReturnName(playerid, 0), amount);
	return 1;
}
Fuzzy is offline   Reply With Quote
Old 18/06/2019, 06:30 PM   #3
alvin6
Little Clucker
 
Join Date: Mar 2017
Posts: 38
Reputation: 2
Default Re: How to make command to give player armour

Quote:
Originally Posted by Fuzzy View Post
Code:
CMD:setarmor(playerid, params[])
{
	static
		userid,
	    Float:amount;

	if (PlayerData[playerid][pAdmin] < 3)
	    return SendErrorMessage(playerid, "You don't have permission to use this command.");

	if (sscanf(params, "uf", userid, amount))
		return SendSyntaxMessage(playerid, "/setarmor [playerid/name] [amount]");

	if (userid == INVALID_PLAYER_ID)
	    return SendErrorMessage(playerid, "You have specified an invalid player.");

    SetPlayerArmour(userid, amount);
	SendAdminAction(playerid, "You have set %s's armour to %.2f.", ReturnName(userid, 0), amount);
	SendAdminAction(userid, "Administrator %s has set your armour to %.2f.", ReturnName(playerid, 0), amount);
	return 1;
}

CMD:sethealth(playerid, params[])
{
	static
		userid,
	    Float:amount;

	if (PlayerData[playerid][pAdmin] < 1)
	    return SendErrorMessage(playerid, "You don't have permission to use this command.");

	if (sscanf(params, "uf", userid, amount))
		return SendSyntaxMessage(playerid, "/sethealth [playerid/name] [amount]");

	if (userid == INVALID_PLAYER_ID)
	    return SendErrorMessage(playerid, "You have specified an invalid player.");

	SetPlayerHealth(userid, amount);
	SendAdminAction(playerid, "You have set %s's health to %.2f.", ReturnName(userid, 0), amount);
	SendAdminAction(userid, "Administrator %s has set your health to %.2f.", ReturnName(playerid, 0), amount);
	return 1;
}
Hi thanks but i dont want it for admin i want it for player to replenish his health and armour please edit it
alvin6 is offline   Reply With Quote
Old 18/06/2019, 06:34 PM   #4
Fuzzy
Little Clucker
 
Join Date: May 2019
Posts: 29
Reputation: 0
Default Re: How to make command to give player armour

Quote:
Originally Posted by alvin6 View Post
Hi thanks but i dont want it for admin i want it for player to replenish his health and armour please edit it
Code:
CMD:hp(playerid, params[])
{
    SetPlayerHealth(playerid, 100);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, " You have get yourself a painkiller");
    return 1:
}

CMD:armor(playerid, params[])
{
    SetPlayerArmour(playerid, 100);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, " You have get yourself a vest");
    return 1:
}
Fuzzy is offline   Reply With Quote
Old 18/06/2019, 06:43 PM   #5
alvin6
Little Clucker
 
Join Date: Mar 2017
Posts: 38
Reputation: 2
Default Re: How to make command to give player armour

Thank you very much
alvin6 is offline   Reply With Quote
Old 18/06/2019, 06:52 PM   #6
Fuzzy
Little Clucker
 
Join Date: May 2019
Posts: 29
Reputation: 0
Default Re: How to make command to give player armour

Quote:
Originally Posted by alvin6 View Post
Thank you very much
No problem.
Fuzzy 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
Command give money for me and player henkas Scripting Help 1 03/01/2017 06:57 PM
How to make ding sound on player give damage? SpikY_ Scripting Help 4 25/08/2014 02:47 PM
Give Player Vehicle command. Mariooo Scripting Help 15 14/08/2013 07:28 PM
Give armour To Only V.I.P'S California_ Scripting Help 2 25/01/2013 09:52 PM
i wan't make a /give command peterory Scripting Help 3 15/06/2012 02:55 PM


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


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