SA-MP Forums Archive
Help me o.O - 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: Help me o.O (/showthread.php?tid=99699)



Help me o.O - Taz86 - 29.09.2009

Hey guys

I want help me with this thing:


Im with some other in same team

When I shoot you(Other player) Your Hp wont go down but mine will be as 0(Got killed) And than a msge comes and says:
"Dont Team Kill Other!"

How Do I do it?


Re: Help me o.O - _Vortex - 29.09.2009

pawn Код:
if(gTeam[killerid] != gTeam[playerid]) {
SendClientMessage(playerid,color,"Don't Team Kill Other!");
}
Under "OnPlayerDeath"



Re: Help me o.O - Taz86 - 29.09.2009

No no no

This will show when I kill team member.

I dont want this

I want this:

I can shoot the mate but his hp wont fall/lower, But my hp will be 0 (KIll)

Than the msge

I defined teams to all
And team mates cant kill each other
But I want to show the message if a player shoots team mate


Re: Help me o.O - Peter_Corneile - 29.09.2009

He means that he has already defined teams to classes under OnPlayerSpawn and they cant kill team mates ... But he wants that still if a guy shoots another guy , he dies and message shows


Re: Help me o.O - _Vortex - 29.09.2009

Quote:
Originally Posted by Taz86
No no no

This will show when I kill team member.

I dont want this

I want this:

I can shoot the mate but his hp wont fall/lower, But my hp will be 0 (KIll)

Than the msge

I defined teams to all
And team mates cant kill each other
But I want to show the message if a player shoots team mate
I'm not sure if that's possible. xD


Re: Help me o.O - Desert - 29.09.2009

Quote:

I'm not sure if that's possible. xD

I don't think it is

Unless someone makes a callback that gets called when player changes HP

Could actualy be usefull

Edit: Typo


Re: Help me o.O - _Vortex - 29.09.2009

Quote:
Originally Posted by Desert
Quote:

I'm not sure if that's possible. xD

I don't think it is

Unless someone makes a callback that gets called when player uses HP

Could actualy be usefull
I just found something

http://forum.sa-mp.com/index.php?topic=82583.0

You can probably make something with "OnPlayerHealthChange"


Re: Help me o.O - clavador - 29.09.2009

I got an idea to do it, but its complicated (not to understand or do it) and I don't think it would be usefull at all.

Let the bastard kill your teammate and then kick him after a few times doing the same thing.


Re: Help me o.O - _Vortex - 29.09.2009

That's easy.

pawn Код:
if(gTeam[killerid] != gTeam[playerid]) {
SetPlayerHealth(killerid,0);
}
But I don't think he wants that.


Re: Help me o.O - Taz86 - 29.09.2009

Well thanks guys!

But Now I want:

I cant shoot the tema member, His hp wont go down than msge.

What lines?


Re: Help me o.O - Peter_Corneile - 29.09.2009

I think its enough to stop team kills by just using gTeams


Re: Help me o.O - Peter_Corneile - 29.09.2009

Quote:

Well thanks guys!

But Now I want:

I cant shoot the tema member, His hp wont go down than msge.

What lines?

If that would be possible then we would make that kill thing too lol ..


Re: Help me o.O - _Vortex - 29.09.2009

Quote:
Originally Posted by Taz86
Well thanks guys!

But Now I want:

I cant shoot the tema member, His hp wont go down than msge.

What lines?
You can't make it send a message if a player shoots his team.

You can make it so there's no teamkill though.

OnPlayerSpawn
pawn Код:
if(gTeam[playerid] == TEAM_WHATEVER)
{
SetPlayerTeam(playerid,TEAM_WHATEVER);
Note: SetPlayerTeam doesn't work fully, its kinda broken. (It should be fixed in 0.3, I think)


Re: Help me o.O - Desert - 29.09.2009

Quote:
Originally Posted by [B
Vortex ]
Quote:
Originally Posted by Desert
Quote:

I'm not sure if that's possible. xD

I don't think it is

Unless someone makes a callback that gets called when player uses HP

Could actualy be usefull
I just found something

http://forum.sa-mp.com/index.php?topic=82583.0

You can probably make something with "OnPlayerHealthChange"
I just noticed that this script uses OnPlayerUpdate.

So this means you will have to put all you make in the same callback

Plus im not sure on this but my guess would be the more you use these callbacks the more your server ping will be increased


Re: Help me o.O - _Vortex - 29.09.2009

Quote:
Originally Posted by Desert
Quote:
Originally Posted by [B
Vortex ]
Quote:
Originally Posted by Desert
Quote:

I'm not sure if that's possible. xD

I don't think it is

Unless someone makes a callback that gets called when player uses HP

Could actualy be usefull
I just found something

http://forum.sa-mp.com/index.php?topic=82583.0

You can probably make something with "OnPlayerHealthChange"
I just noticed that this script uses OnPlayerUpdate.

So this means you will have to put all you make in the same callback

Plus im not sure on this but my guess would be the more you use these callbacks the more your server ping will be increased
Ping is increased on how far away from the server you are, OR, how good the internet connection is for the serer.

OnPlayerUpdate can cause lag, but not ping increasing.


Re: Help me o.O - Taz86 - 29.09.2009

ok thanks all :P


Re: Help me o.O - Desert - 29.09.2009

Ping lag whatever

But what im saying is that these (same with OnPlayerUpdate) only should be used when needed


Re: Help me o.O - ded - 29.09.2009

OnPlayerUpdate shouldn't contain more than a few things. It's a dangerous function.