Commands for Marines !
#1

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?
Reply
#2

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;
}
Reply
#3

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.
Reply
#4

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)