Pickup when kill a medic? -
Face9000 - 19.12.2010
Hi all,in my gm i use gTeam and i've medics team:
TEAM_MEDICS
I need to do,if a player kill a medic,a pickup of 15% health will be dropped when the medic dies.
I know i need to work on OnPlayerDeath,but how?
Thanks
Re: Pickup when kill a medic? -
matute - 19.12.2010
At onPlayerDeath Create a pickup and at Onplayerpickup make it to give to the player 15% of 100?
Re: Pickup when kill a medic? -
Face9000 - 19.12.2010
Yeah i know that but,i need to drop the pickup ONLY when u kill a MEDIC.
Re: Pickup when kill a medic? -
Rachael - 19.12.2010
If you at least try to script it I will help you, but your requests for scripting help are all kind of "can you script this for me" rather than "can you tell me why this isn't working"
Re: Pickup when kill a medic? -
matute - 19.12.2010
Quote:
Originally Posted by Logitech90
Yeah i know that but,i need to drop the pickup ONLY when u kill a MEDIC.
|
You can use something like killerid or getteam, i dont know it takes me a hour to script it and now i dont have time, sorry but you understand me right? You can add something like
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new Float:Health;
GetPlayerHealth(victimid, Health);
new Float:x,Float:y,Float:z;
GetPlayerPos(victimid, x, y, z);
if(Health == 0.0)
{
if(gClass[playerid] = you medic class)
{
medpickup = createpickup(blahblahblah)
}
}
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if (pickupid == medpickup)
{
Setplayerhealth(blahblahblah)
return 1;
}
}
i dont know if it works, but if not you can figure it out, i made all the whole code to you xD
Re: Pickup when kill a medic? -
Face9000 - 19.12.2010
Quote:
Originally Posted by Rachael
If you at least try to script it I will help you, but your requests for scripting help are all kind of "can you script this for me" rather than "can you tell me why this isn't working"
|
If the world will run as like u think,no one will help others.
And btw,i can script for myself,i just post code when i REALLY need help (ex: functions dont working or other).
@matute,thanks.
Re: Pickup when kill a medic? -
matute - 19.12.2010
Quote:
Originally Posted by Logitech90
If the world will run as like u think,no one will help others.
And btw,i can script for myself,i just post code when i REALLY need help (ex: functions dont working or other).
@matute,thanks.
|
sometimes its hard to post your code because you think anyone will steal your code, thats why some people dont post them and i understand, its hard for me too
Re: Pickup when kill a medic? -
Face9000 - 19.12.2010
Yeah,but i dont care if someone steal my code.I give you an example:
Look at this COD servers,they've all same gm,and guess what?Only original servers has much players,the others copy has less 10-20 at day.