Raised This Month: $ Target: $400
 0% 

Restrict Functiuon to Model


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Stephen
Senior Member
Join Date: Aug 2004
Old 10-14-2006 , 15:20   Restrict Functiuon to Model
Reply With Quote #1

Code:
public function(id) {     if (EArray[id] == 0)     if (entity_get_int(id, EV_INT_playerclass) == 1)     {         new animation = entity_get_int(id, EV_INT_sequence)         if (animation == 1)         {             if (get_pdata_int(id, 666) > 1)                     set_task(0.1,"Ignition",id)             return PLUGIN_HANDLED         }     }     return PLUGIN_CONTINUE }

Hey there.
I have an question HOW would i stop "function(id)" from beeing used when the correct model inst used.
Lets say you have to be SuperduperModel.mdl to make the above Fuction work.

I hope you understand what i mean.
__________________
www.corona-bytes.net (ECX = ESF Addon)
Stephen is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 10-16-2006 , 09:52   Re: Restrict Functiuon to Model
Reply With Quote #2

Code:
if(cs_get_user_model(id, "SuperduperModel.mdl")) {      set_task(0.1, "function", id) }
__________________
DO NOT PM me about avp mod.

Last edited by Rolnaaba; 10-16-2006 at 09:56.
Rolnaaba is offline
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 10-16-2006 , 10:12   Re: Restrict Functiuon to Model
Reply With Quote #3

Rollnaab, seriously, stop posting rubbish.

---

Stephen, you got 2 if clauses that don't make any sense. The first one and the one with if(get_pdata_int...).

Just put this on top of the function to only make it work for the gaben model:

Code:
static userModel[32]; cs_get_user_model(id, userModel, 31); if( !equal(userModel, "gaben.mdl") )      return PLUGIN_HANDLED
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-16-2006 , 12:23   Re: Restrict Functiuon to Model
Reply With Quote #4

Quote:
Originally Posted by Rolnaaba View Post
Code:
if(cs_get_user_model(id, "SuperduperModel.mdl")) {      set_task(0.1, "function", id) }
Adding to what Maximus said, here is what is wrong. I also have no idea why or who would post that code like that:
  • That is not how the native decleration is. cs_get_user_model returns a players model through a string buffer provided the programmer.
  • Stop using set_tasks to call functions. If you don't know how to call a function, read the tutorials.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 10-16-2006 , 12:38   Re: Restrict Functiuon to Model
Reply With Quote #5

Zenith: set_task() was used in the original code
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-16-2006 , 19:48   Re: Restrict Functiuon to Model
Reply With Quote #6

*Jumps off clip.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-16-2006 , 21:14   Re: Restrict Functiuon to Model
Reply With Quote #7

The model returned from cs_get_user_model would be "gaben", not "gaben.mdl".
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Reply



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 04:44.


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