SA-MP Forums Archive
Little help here please. - 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: Little help here please. (/showthread.php?tid=200207)



Little help here please. - Mr L - 17.12.2010

Hello All,

I want to create something like if i will kill someone i will get a message: "%s[playerid] has killed %s[giveplayerid] with a %s[weapon], %d withesses" i dont know how to create the distange betwert [giveplayerid] near to him, example if i will kill someone with m4 i will get a message: "Kinto has killed TestName with a M4, %d withesses" i dont know how to create the %d withesses, can someone help me please to create the withesses fuction please?


Re: Little help here please. - Mr L - 17.12.2010

please help i need this


Re: Little help here please. - WillyP - 17.12.2010

Use

IsPlayerInRangeOfPoint


Re: Little help here please. - Mr L - 17.12.2010

Quote:
Originally Posted by [FU]Victious
Посмотреть сообщение
Use

IsPlayerInRangeOfPoint
I want the withsess if they are near the dead player... not point


Re: Little help here please. - WillyP - 17.12.2010

Quote:
Originally Posted by Kinto
Посмотреть сообщение
I want the withsess if they are near the dead player... not point
Yes...

lrn2useit

You can use it to calculate the dead persons' position.


Re: Little help here please. - Mr L - 17.12.2010

Ok i got this with the IsPlayerInRangeOf but can you tell me how i can make it so i will know how much withess was near to him , like: 5 withesses, can you post me a example please?


Re: Little help here please. - Ash. - 17.12.2010

Quote:
Originally Posted by Kinto
Посмотреть сообщение
Код:
GetPlayerPos(playerid, x, y, z);

if(IsPlayerInRangeOfPoint(i, 5.0, x, y, z))
{
    format(string,128,"%s killed %s with a %s, %d withesses.",killer,name,weapname,withess);
}
Ok i got it thanks
Else if?


Re: Little help here please. - Mr L - 17.12.2010

Quote:
Originally Posted by [FU]Victious
Посмотреть сообщение
Use

IsPlayerInRangeOfPoint
Quote:
Originally Posted by funky1234
Посмотреть сообщение
Else if?
my mistake sorry.


Re: Little help here please. - Mr L - 17.12.2010

can someone help me pleaes?


Re: Little help here please. - Biesmen - 17.12.2010

Learn the freaking rules:
https://sampforum.blast.hk/showthread.php?tid=45235



Did you even bother to read "READ BEFORE POSTING" STICKIED topic?


pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new string[51], giveplayerid, giveplayer[MAX_PLAYER_NAME], playername[MAX_PLAYER_NAME], killerplayer[MAX_PLAYER_NAME];
GetPlayerPos(playerid, x, y, z);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerName(killerid, killerplayer, sizeof(killerplayer));
       if(IsPlayerInRangeOfPoint(giveplayerid, 5.0, x, y, z))
       {
       format(string, sizeof(string),"%s got killed by %s. Witness: %s", playername, killerplayer, giveplayer);
       SendClientMessageToAll(COLOR_WHITE, string);
       }
return 1;
}