AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Traceline help-.-' (https://forums.alliedmods.net/showthread.php?t=60614)

fxfighter 09-08-2007 12:00

Traceline help-.-'
 
Traceline this dont work enyone know why?
want players whit same numbers unable to hit each other.
so same number count as miss dont wanna use add hp or enything like that.
gonna use this in my plugin so +karma if you help me =)

PHP Code:

public traceline(Float:v1[3], Float:v2[3], noMonsterspentToSkip){
 new 
iAttacker pentToSkip;
 new 
iVictim get_tr(TR_pHit);
 
 if (
iVictim >= && iVictim <= g_MaxPlayers && iAttacker >= && iAttacker <= g_MaxPlayers){
  if (
PlayersTeam[iVictim] == PlayersTeam[iVictim]){
   
set_tr(TR_flFraction1.0);
   return 
FMRES_SUPERCEDE;
  }
 } 
 return 
FMRES_IGNORED;



Arkshine 09-08-2007 12:24

Re: Traceline help-.-'
 
Try something like :

Code:
new g_iMaxPlayers; public plugin_init() {     register_forward( FM_TraceLine, "fw_traceline", 1 );         g_iMaxPlayers = get_maxplayers(); } public fw_traceline( Float:start[3], Float:end[3], noMonsters, id, trace ) {     if( !is_user_connected( id ) || !is_user_alive( id ) )         return FMRES_IGNORED;         static iVictim;     iVictim = get_tr2( trace, TR_pHit );         if( !( 1 <= iVictim <= g_iMaxPlayers ) )         return FMRES_IGNORED;             if( PlayersTeam[ id ] == PlayersTeam[ iVictim ] )     {         set_tr2( trace, TR_flFraction, 1.0 );         return FMRES_SUPERCEDE;     }     return FMRES_IGNORED; }


Notes:

- PlayersTeam[ iVictim ] == PlayersTeam[ iVictim ] <== can't work with that. :p

fxfighter 09-08-2007 12:30

Re: Traceline help-.-'
 
THx it works +karma but i cant.
i gave you like yesterday-.-
so i give you so fast as i can
i will write it down

Quote:

you most spread some reputation around
before giving it to arkshine agin

Alka 09-08-2007 12:47

Re: Traceline help-.-'
 
Quote:

Originally Posted by arkshine (Post 528887)
Notes:

- PlayersTeam[ iVictim ] == PlayersTeam[ iVictim ] <== can't work with that. :p

Yeah, lol >.>


All times are GMT -4. The time now is 16:08.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.