Commands for Marines ! - 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: Commands for Marines ! (
/showthread.php?tid=113805)
Commands for Marines ! -
drawkk - 15.12.2009
Hi Niggaz' !
So,I wanna make an /equip with a command /heal [ID].I don't know if you're Undurstand so I make an Example :
If a do : /equip 12 on a "i" Point,I will have a M4,a deagle,a Armor and a Commands Who's => /heal [ID]
That's Possible?
And..How I can do it?
Re: Commands for Marines ! -
Camacorn - 15.12.2009
to make the weapon/armour thing, here you go:
PUT THIS UNDER: "public: OnPlayerCommandText"
Код:
if (strcmp("/equip", cmdtext, true, 10) == 0)
{
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 24, 300); //Deagle 300 AMMO
GivePlayerWeapon(playerid, 31, 300); //M4 300 AMMO
SetPlayerArmour( playerid, 100 );
return 1;
}
HEAL COMMAND:
PUT THIS UNDER: "public: OnPlayerCommandText" :
Код:
if (strcmp("/heal", cmdtext, true, 10) == 0)
{
SetPlayerHealth( playerid, 100 );
return 1;
}
Re: Commands for Marines ! -
kamilbam - 15.12.2009
If you want the command to work only at 'i' pickup then you should use
Код:
if(!strcmp("/eqheal",cmdtext)) //this command heals player and equip him
{
if(IsPlayerInRangeOfPoint(playerid, range, x, y, z))// cords of your pickup
ResetPlayerWeapons(playerid);// resets the old weapons
GivePlayerWeapon(playerid, weaponid, ammo); //weapon 1
GivePlayerWeapon(playerid, weaponid, ammo); //weapon 2
GivePlayerWeapon(playerid, weaponid, ammo); //weapon 3 etc
SetPlayerHealth(playerid, 100); //gives player 100hp
SetPlayerArmour(playerid, 100); //gives player 100 armour
return 1;
}
And of cuz you have to create pickup.
If there are some typos im sorry but i was meeega tired.
Re: Commands for Marines ! -
Camacorn - 15.12.2009
Ok, i forgot to do the "I" thing, here you go, also thanks to the post above this one, but i made it easier by putting the weapon IDS etc...
Код:
if (strcmp("/equip", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, range, x, y, z))// cords of your pickup
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 24, 300); //Deagle 300 AMMO
GivePlayerWeapon(playerid, 31, 300); //M4 300 AMMO
SetPlayerArmour( playerid, 100 );
return 1;
}