Help me o.O
#1

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

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

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

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
Reply
#5

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
Reply
#6

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

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"
Reply
#8

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

That's easy.

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

Well thanks guys!

But Now I want:

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

What lines?
Reply
#11

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

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

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)
Reply
#14

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
Reply
#15

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

ok thanks all :P
Reply
#17

Ping lag whatever

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

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


Forum Jump:


Users browsing this thread: 6 Guest(s)