even tried the wiki version \/
function onPlayerKill( killer, player, reason, bodypart )
{
Message( "** " + killer.Name + " killed " + player.Name + " (" + GetWeaponName( reason ) + ") (" + bodypart + ")" );
}
any explanation to why or what could be interfering with this?
i even added print. Nothing ???
I'm guessing that when you tested it, the killer and player were in the same team.
That would have resulted in calling onPlayerTeamKill and skipped onPlayerKill
I did not think of this as i don't have teams, When I get off of work i will retest! problem more than likely solved! Thanks
This isn't LU! You can use only ClientMessage and ClientMessageToAll for send message on chat ;)
function onPlayerKill( killer, player, reason, bodypart )
{
ClientMessageToAll( "** " + killer.Name + " killed " + player.Name + " (" + GetWeaponName( reason ) + ") (" + bodypart + ")",255,128,0,255);
}
I had noticed this in the wiki. but MessagePlayer does exist and this Message is in the wiki. I will convert some time, Thanks for the tip! ;)
My mistake.. You can use MessagePlayer/Message on VC-MP, but i never use this functions, and I think that doesn't exist.
Message and other shits work well here.
Motley, try this:
function onPlayerTeamKill( k, p, r, b ) onPlayerKill( k, p, r, b );
function onPlayerKill( k, p, r, b ){
Message("Something happened");
}
Quote from: KAKAN on Mar 19, 2016, 02:42 AMMessage and other shits work well here.
Motley, try this:
function onPlayerTeamKill( k, p, r, b ) onPlayerKill( k, p, r, b );
function onPlayerKill( k, p, r, b ){
Message("Something happened");
}
LOL something happened !
I never thought of sharing functions together " You taught me something.
I would of done
|
k, p, r, b
what does this stand for?
killer, player, r, b,???
Quote from: Mr_Motley on Mar 19, 2016, 04:03 AMQuote from: KAKAN on Mar 19, 2016, 02:42 AMMessage and other shits work well here.
Motley, try this:
function onPlayerTeamKill( k, p, r, b ) onPlayerKill( k, p, r, b );
function onPlayerKill( k, p, r, b ){
Message("Something happened");
}
LOL something happened !
I never thought of sharing functions together " You taught me something.
I would of done
|
k, p, r, b
what does this stand for?
killer, player, r, b,???
Well, you could name these events anything you know,
function onPlayerKill( killer, player, reason, bodypart )
{
ClientMessageToAll("" + player + " Has been killed by " + killer + "",255,255,0);
}
like
function onPlayerKill( THE_KILLER, VICTIM, OV_Reason, WHICH_PART_IT_SHOOT )
{
ClientMessageToAll("" + VICTIM + " Has been killed by " + THE_KILLER + "",255,255,0);
}
will work the same ;)
AND
function onPlayerKill( killer, player, reason, bodypart )
{
ClientMessageToAll( "** " + killer.Name + " killed " + player.Name + " (" + GetWeaponName( reason ) + ") (" + bodypart + ")"[code],255,128,0,255
);
}
change this line to
ClientMessageToAll( "** " + killer.Name + " killed " + player.Name + " (" + GetWeaponName( reason ) + ") (" + bodypart + ")",255,128,255);
Since in RGB Colors, only three colors are used not FOUR!
255,128,0,255 @rwwpl wpl ;)
*cough cough*
You're wrong Mr.
@KAKAN , It's RGBA. You can provide 4 parameters.
Quote from: Xmair on Mar 19, 2016, 04:18 AM*cough cough*
You're wrong Mr.@KAKAN , It's RGBA. You can provide 4 parameters.
Okay, never thougt of that. :)
So what do I need to do to have only One kill function? I want to have a Independent server. looks like its going to take a lot of stress testing on the kill system as Teams are set default unfortunately instead of adding scripted support for teams?
any suggestions would be helpful. ^^^^ everything in this post has helped me a lot!!! Thanks Everyone
@KAKAN THANKS FOR THE CODE! I modified it
"I just wish there was a distance function in the wiki so i can write longest headshots to stats!
Honestly! "I am too much of a noob to know how to script that " ???
somethings I just don't know and majority of the time when i see a code like distance I think "why didn't I think of that!
Quote from: Xmair on Mar 19, 2016, 04:18 AM*cough cough*
You're wrong Mr.@KAKAN , It's RGBA. You can provide 4 parameters.
Well, what are you talking about? I don't need alpha in the WastedScreen function. So, why shall I use it? Don't worry, you won't be able to see the wasted screen since the fain and fadeout time is 0 ms :P
Quote from: MaTaDeToR on Mar 19, 2016, 04:07 AMWell, you could name these events anything you know,
Sorry, was at phone at that time.
Quote from: Mr_Motley on Mar 19, 2016, 04:03 AMk, p, r, b
what does this stand for?
killer, player, r, b,???
Reason, bodypart :P Well, you can see the onPlayerKill's params, it's exactly same as of onPlayerTeamKill.
Quote from: Mr_Motley on Mar 19, 2016, 04:32 AM"I just wish there was a distance function in the wiki so i can write longest headshots to stats!
there you go. ( donno who made it )
function Distance(x1, y1, x2, y2)
{
local dist = sqrt(((x2 - x1)*(x2 - x1)) + ((y2 - y1)*(y2 - y1)));
return dist;
}
just an example of using the function.
function onPlayerKill( killer, player, bodypart, reason )
{
PrivMessage( player, "killed by "+killer.Name+" Distance: "+Distance( killer.Pos.x, killer.Pos.y, player.Pos.x, player.Pos.y )+"." );
}
*again coughs*
DistanceFromPoint ( x1, y1, x2, y2 )
Quote from: Xmair on Mar 19, 2016, 09:23 AM*again coughs*
DistanceFromPoint ( x1, y1, x2, y2 )
error: z missing.
Quote from: Decent_946 on Mar 19, 2016, 09:24 AMQuote from: Xmair on Mar 19, 2016, 09:23 AM*again coughs*
DistanceFromPoint ( x1, y1, x2, y2 )
error: x3 missing.
DistanceFromPoint(killer.Pos.x, killer.Pos.y, player.Pos.x,player.Pos.y);
Quote from: Decent_946 on Mar 19, 2016, 09:24 AMQuote from: Xmair on Mar 19, 2016, 09:23 AM*again coughs*
DistanceFromPoint ( x1, y1, x2, y2 )
error: x3 missing.
What's the use of x3 there?
I would say, z1, z2 are missing. Why would someone need the Z here?
@Decent_946 , ever viewed the
wiki? (http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions/DistanceFromPoint)
Quote from: Xmair on Mar 19, 2016, 09:35 AM@Decent_946 , ever viewed the wiki? (http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions/DistanceFromPoint)
ofc, btw, atm i am too depressed cuz of my test. so that's why..
i 1st wanted to post that function but thought to give z axis also. ;) .
Quote from: Kusanagi on Mar 19, 2016, 09:30 AMQuote from: Decent_946 on Mar 19, 2016, 09:24 AMQuote from: Xmair on Mar 19, 2016, 09:23 AM*again coughs*
DistanceFromPoint ( x1, y1, x2, y2 )
error: x3 missing.
DistanceFromPoint(killer.Pos.x, killer.Pos.y, player.Pos.x,player.Pos.y);
killer.Pos.Distance(player.Pos)
you guys are amazing!!! I noticed something I dont like, and that is bodypart names say head, right leg, left leg., right arm, left arm, and Dick, I guess i should create locals...?
Quote from: Mr_Motley on Mar 19, 2016, 04:12 PMyou guys are amazing!!! I noticed something I dont like, and that is bodypart names say head, right leg, left leg., right arm, left arm, and Dick, I guess i should create locals...?
I assume your server does not have female skins then
Quote from: Murdock on Mar 19, 2016, 04:36 PMQuote from: Mr_Motley on Mar 19, 2016, 04:12 PMyou guys are amazing!!! I noticed something I dont like, and that is bodypart names say head, right leg, left leg., right arm, left arm, and Dick, I guess i should create locals...?
I assume your server does not have female skins then
lel never would of thought of that ;D
is it possible to turn the body part ids, From ids to words?
Referring to this post for the second time :D
http://forum.vc-mp.org/?topic=254.0
??? I Am confused as I am looking for body part names? I really do not understand that post
LOL fixed
if ( limb == 1 ) limb = "Dick";
Message( killer + " sent to hospital " + player + " (" + wep + ") (" + limb + ") (" + distance + "m)" );
Speacial thanks to PunkNoodle
this post may help you http://forum.vc-mp.org/?topic=400.msg2563#msg2563 you can edit returning instance as you want them like left shoulder instead left arm
Yes I like that method better than
function onPlayerTeamKill( killer, player, reason, bodypart) onPlayerKill( killer, player, reason, bodypart)
function onPlayerKill( killer, player, reason, bodypart)
{
local pos = killer.Pos;
local rot = killer.Angle, rad = rot * PI / 180.0;
local x = pos.x, y = pos.y, z = pos.z;
local x2 = x + 0.01 * cos(rad) - 5.0 * sin(rad);
local y2 = y + 0.01 * sin(rad) + 5.0 * cos(rad);
local wep = GetWeaponName( reason ), limb = ( bodypart ), distance = DistanceFromPoint(killer.Pos.x, killer.Pos.y, player.Pos.x,player.Pos.y);
if ( limb == 0 ) limb = "Torso";
if ( limb == 1 ) limb = "Dick";
if ( limb == 6 ) limb = "Head";
if ( limb == 3 ) limb = "Right-Arm";
if ( limb == 4 ) limb = "Left-Leg";
if ( limb == 5 ) limb = "Right-Leg";
if ( limb == 2 ) limb = "Left-Arm";
Message( killer + " sent to hospital " + player + " (" + wep + ") (" + limb + ") (" + distance + "m)" );
return 1;
}
I will convert
Quote from: Mr_Motley on Mar 19, 2016, 05:40 PMYes I like that method better than
function onPlayerTeamKill( killer, player, reason, bodypart) onPlayerKill( killer, player, reason, bodypart)
function onPlayerKill( killer, player, reason, bodypart)
{
local pos = killer.Pos;
local rot = killer.Angle, rad = rot * PI / 180.0;
local x = pos.x, y = pos.y, z = pos.z;
local x2 = x + 0.01 * cos(rad) - 5.0 * sin(rad);
local y2 = y + 0.01 * sin(rad) + 5.0 * cos(rad);
local wep = GetWeaponName( reason ), limb = ( bodypart ), distance = DistanceFromPoint(killer.Pos.x, killer.Pos.y, player.Pos.x,player.Pos.y);
if ( limb == 0 ) limb = "Torso";
if ( limb == 1 ) limb = "Dick";
if ( limb == 6 ) limb = "Head";
if ( limb == 3 ) limb = "Right-Arm";
if ( limb == 4 ) limb = "Left-Leg";
if ( limb == 5 ) limb = "Right-Leg";
if ( limb == 2 ) limb = "Left-Arm";
Message( killer + " sent to hospital " + player + " (" + wep + ") (" + limb + ") (" + distance + "m)" );
return 1;
}
I will convert
However, this could be a great use of Switch.
Sorry for bump...
@MaTaDeToRIn ClientMessage/ClientMessageToAll function you can use RGB or RGBA ;) Before you can use only RGBA (year ago).
Quote from: rwwpl on Apr 05, 2016, 07:12 AMSorry for bump...
@MaTaDeToR
In ClientMessage/ClientMessageToAll function you can use RGB or RGBA ;) Before you can use only RGBA (year ago).
;) alright i didn't noticed that! thanks.