Raised This Month: $ Target: $400
 0% 

DodgeBall


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 01-19-2013 , 10:47   DodgeBall
Reply With Quote #1

Okay so how can i make so when you trow a dodgeball it will disappear after 4 seconds on the ground
and is it any way i can do so the model is on the ground when i throw a dodgeball its half in the ground and half up

Code:
public Ham_Touch_Grenade_Pre( iEntity, id )
{
if( GAME_SNOWBALL <= g_iCurrentGame <= GAME_ZMBOMBS || g_iCurrentGame == GAME_SNOWBALL )
{
 if(is_user_alive(id))
 {
  ExecuteHamB(Ham_Killed, id, pev(iEntity, pev_owner), 0)
 
  remove_entity(iEntity)
 }
}
}
public fwdSetModel(ent,const model[])
{ 
if(!pev_valid(ent) || !equal(model,"models/w_hegrenade.mdl")) 
 return FMRES_IGNORED
 
 switch(g_iCurrentGame)
 {
  case GAME_DGBALL: engfunc(EngFunc_SetModel, ent, g_szDodgeball_World)
   case GAME_ZMBOMBS: engfunc(EngFunc_SetModel, ent, g_szZombiebomb_World)
   case GAME_SNOWBALL: engfunc(EngFunc_SetModel, ent, g_szSnowball_World)
   case GAME_ANGRYBIRDS: engfunc(EngFunc_SetModel, ent, g_szAngryBirds_World)
   default: return FMRES_IGNORED
 }
 
 return FMRES_SUPERCEDE
}
public think_grenade(ent) 
{
 new model[32];
 entity_get_string(ent, EV_SZ_model, model, 31)
 
 if(equali(model,"models/w_dodgeball.mdl")) 
 {
  return PLUGIN_CONTINUE
 }
 
 // stop grenade from blowing up
 return PLUGIN_HANDLED
}
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by ironskillz1; 01-19-2013 at 11:29.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 01-20-2013 , 07:18   Re: DodgeBall
Reply With Quote #2

I did this code it removes all dodgeball snowball zombiebomb with a 5 seconds task
so sometimes when you throw it dispear exactly when you throw it
how can i do so each dodgeball/snowball/zombiebomb dispear 5 seconds after you throw it

Code:
public remove()
{
 new ent = - 1, model[32]
 while((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", "grenade")))
 {
  pev(ent, pev_model, model, 32)
  if (equal(model, "models/SWE-KUNG/w_dodgeball.mdl") || equal(model, "models/SWE-KUNG/w_snowball.mdl") || equal(model, "models/SWE-KUNG/w_zombiebomb.mdl"))
  {
   engfunc(EngFunc_RemoveEntity, ent)
  }
 }
}
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by ironskillz1; 01-20-2013 at 07:19.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-20-2013 , 07:31   Re: DodgeBall
Reply With Quote #3

PHP Code:
public remove_ent(iEnt)
{
     if(
pev_valid(iEnt))
         
engfunc(EngFunc_RemoveEntity,iEnt);
 } 
and somewhere set task -> set_task(5.0,"remove_ent",entity_id);
for example in set_model function.

but inside touch you should remove_task(entity_id). cause it can double remove..so this is bad..
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT

Last edited by AngeIII; 01-20-2013 at 07:52.
AngeIII is offline
Send a message via Skype™ to AngeIII
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 01-20-2013 , 08:20   Re: DodgeBall
Reply With Quote #4

Nothing disappears now :S
code
Code:
public remove_ent(iEnt)
{
if(pev_valid(iEnt))
engfunc(EngFunc_RemoveEntity,iEnt);
}
Code:
public Ham_Touch_Grenade_Pre( iEntity, id, ent, entity_id)
{
if( GAME_SNOWBALL <= g_iCurrentGame <= GAME_ZMBOMBS || g_iCurrentGame == GAME_SNOWBALL )
{
 if(is_user_alive(id))
 {
  ExecuteHamB(Ham_Killed, id, pev(iEntity, pev_owner), 0)
  
  remove_entity(iEntity)
  remove_task(entity_id)
  }
 }
}
public fwdSetModel(ent,const model[])
{ 
if(!pev_valid(ent) || !equal(model,"models/w_hegrenade.mdl")) 
 return FMRES_IGNORED
 
switch(g_iCurrentGame)
 {
  case GAME_DGBALL: engfunc(EngFunc_SetModel, ent, g_szDodgeball_World)
   case GAME_ZMBOMBS: engfunc(EngFunc_SetModel, ent, g_szZombiebomb_World)
   case GAME_SNOWBALL: engfunc(EngFunc_SetModel, ent, g_szSnowball_World)
   case GAME_ANGRYBIRDS: engfunc(EngFunc_SetModel, ent, g_szAngryBirds_World)
   default: return FMRES_IGNORED
 }
return FMRES_SUPERCEDE
}
public think_grenade(iEntity, ent, entity_id) 
{
if( GAME_SNOWBALL <= g_iCurrentGame <= GAME_ZMBOMBS || g_iCurrentGame == GAME_SNOWBALL || g_iCurrentGame == GAME_ANGRYBIRDS)
{
 new model[32];
 entity_get_string(ent, EV_SZ_model, model, 31)
 
 if(equali(model,"models/w_dodgeball.mdl")) 
 {
  return PLUGIN_CONTINUE
 }
 
 // stop grenade from blowing up
 set_task(5.0,"remove_ent",entity_id);
 return PLUGIN_HANDLED
 }
}
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-20-2013 , 08:51   Re: DodgeBall
Reply With Quote #5

you have a lot of mistakes..

PHP Code:
public Ham_Touch_Grenade_PreiEntityid )
{
if( 
GAME_SNOWBALL <= g_iCurrentGame <= GAME_ZMBOMBS || g_iCurrentGame == GAME_SNOWBALL )
{
 if(
is_user_alive(id))
 {
  
ExecuteHamB(Ham_Killedidpev(iEntitypev_owner), 0)
 
  
remove_entity(iEntity)
  if(
task_exists(iEntity))
    
remove_task(iEntity);
 }
}
}
public 
fwdSetModel(ent,const model[])

if(!
pev_valid(ent) || !equal(model,"models/w_hegrenade.mdl")) 
 return 
FMRES_IGNORED
 
 
switch(g_iCurrentGame)
 {
  case 
GAME_DGBALLengfunc(EngFunc_SetModelentg_szDodgeball_World)
   case 
GAME_ZMBOMBSengfunc(EngFunc_SetModelentg_szZombiebomb_World)
   case 
GAME_SNOWBALLengfunc(EngFunc_SetModelentg_szSnowball_World)
   case 
GAME_ANGRYBIRDSengfunc(EngFunc_SetModelentg_szAngryBirds_World)
   default: return 
FMRES_IGNORED
 
}
  
set_task(5.0,"delete_it",ent);
 return 
FMRES_SUPERCEDE
}
public 
think_grenade(ent
{
 new 
model[32];
 
entity_get_string(entEV_SZ_modelmodel31)
 
 if(
equali(model,"models/w_dodgeball.mdl")) 
 {
  return 
PLUGIN_CONTINUE
 
}
 
 
// stop grenade from blowing up
 
return PLUGIN_HANDLED
}

public 
delete_it(iEnt)
{
     if(
pev_valid(iEnt))
         
engfunc(EngFunc_RemoveEntity,iEnt);

__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT

Last edited by AngeIII; 01-20-2013 at 08:53.
AngeIII is offline
Send a message via Skype™ to AngeIII
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 01-20-2013 , 09:13   Re: DodgeBall
Reply With Quote #6

Quote:
Originally Posted by AngeIII View Post
you have a lot of mistakes..

PHP Code:
public Ham_Touch_Grenade_PreiEntityid )
{
if( 
GAME_SNOWBALL <= g_iCurrentGame <= GAME_ZMBOMBS || g_iCurrentGame == GAME_SNOWBALL )
{
 if(
is_user_alive(id))
 {
  
ExecuteHamB(Ham_Killedidpev(iEntitypev_owner), 0)
 
  
remove_entity(iEntity)
  if(
task_exists(iEntity))
    
remove_task(iEntity);
 }
}
}
public 
fwdSetModel(ent,const model[])

if(!
pev_valid(ent) || !equal(model,"models/w_hegrenade.mdl")) 
 return 
FMRES_IGNORED
 
 
switch(g_iCurrentGame)
 {
  case 
GAME_DGBALLengfunc(EngFunc_SetModelentg_szDodgeball_World)
   case 
GAME_ZMBOMBSengfunc(EngFunc_SetModelentg_szZombiebomb_World)
   case 
GAME_SNOWBALLengfunc(EngFunc_SetModelentg_szSnowball_World)
   case 
GAME_ANGRYBIRDSengfunc(EngFunc_SetModelentg_szAngryBirds_World)
   default: return 
FMRES_IGNORED
 
}
  
set_task(5.0,"delete_it",ent);
 return 
FMRES_SUPERCEDE
}
public 
think_grenade(ent
{
 new 
model[32];
 
entity_get_string(entEV_SZ_modelmodel31)
 
 if(
equali(model,"models/w_dodgeball.mdl")) 
 {
  return 
PLUGIN_CONTINUE
 
}
 
 
// stop grenade from blowing up
 
return PLUGIN_HANDLED
}
 
public 
delete_it(iEnt)
{
     if(
pev_valid(iEnt))
         
engfunc(EngFunc_RemoveEntity,iEnt);

WTF my sever crash when i have this code

if i throw some dodgeball they disappears but the server crash random after
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by ironskillz1; 01-20-2013 at 09:13.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-20-2013 , 09:58   Re: DodgeBall
Reply With Quote #7

i think it because you need some more checks.. and also i dont see full code so i dont know if you really correct use that. but btw you can change function definition instead of pev_valid, engfunc remove ent. to server_print("debug delete_id called with ent_id: %d",iEnt);
and check what happens.
also see a logs files, also check the console, also check other plugins.. also you can add some server_print("debug line X"); // where x is a some line of code.
to check in what place server crashes, think it is because setmodel called more that twice.. so you need to check if task_exists -> delete task, and after set it again..
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT
AngeIII is offline
Send a message via Skype™ to AngeIII
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 01-20-2013 , 11:29   Re: DodgeBall
Reply With Quote #8

tried evrything but either it doesnt work or it crashes



have any one else any ides?
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
zEEDu
Junior Member
Join Date: Jan 2013
Location: Vaasa, Finland
Old 01-21-2013 , 07:35   Re: DodgeBall
Reply With Quote #9

No, because this plugin you're trying t fix is an very old version of Mokens gamemenu that he made for Scandic-Gamers for private use. So i won't help you.
__________________
PM for Private Work!

Scandinavian Gaming Association
zEEDu is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-21-2013 , 07:51   Re: DodgeBall
Reply With Quote #10

ironskillz1, just remove everything what you added from my code and use older version, after that step-by-step add the needed lines. and after each step check how plugins work..
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT
AngeIII is offline
Send a message via Skype™ to AngeIII
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:23.


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