Raised This Month: $ Target: $400
 0% 

[Solved! Thx Guys!] More Than One Sprite In A G_Variable


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jc980
Veteran Member
Join Date: Jan 2010
Location: God is with us...
Old 05-03-2011 , 07:18   [Solved! Thx Guys!] More Than One Sprite In A G_Variable
Reply With Quote #1

Is It Possible Enough That More Than One Sprite, Can Be Stored In A G_Variable?
__________________

Last edited by jc980; 05-04-2011 at 11:18.
jc980 is offline
ZeN'
New Member
Join Date: Jul 2010
Old 05-03-2011 , 07:58   Re: [Question] More Than One Sprite In A G_Variable
Reply With Quote #2

Did you mean something like this?

PHP Code:
//In global namespace
new sprExplode];

public 
plugin_precache(  ) {
    
sprExplode] = precache_model"somesprite.spr" );
    
sprExplode] = precache_model"somesprite2.spr" );

ZeN' is offline
jc980
Veteran Member
Join Date: Jan 2010
Location: God is with us...
Old 05-03-2011 , 08:07   Re: [Question] More Than One Sprite In A G_Variable
Reply With Quote #3

Quote:
Originally Posted by ZeN' View Post
Did you mean something like this?

PHP Code:
//In global namespace
new sprExplode];

public 
plugin_precache(  ) {
    
sprExplode] = precache_model"somesprite.spr" );
    
sprExplode] = precache_model"somesprite2.spr" );

yes, but...

1. how do randomize it.
2. i use this method to precache. in which only one shows up.
PHP Code:
for(0sizeof zp_cso_respawnspritei++) 
        
zp_cso_respawnspr engfunc(EngFunc_PrecacheModelzp_cso_respawnsprite[i]) 
how can i do that without precaching again and again.
__________________
jc980 is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 05-03-2011 , 08:32   Re: [Question] More Than One Sprite In A G_Variable
Reply With Quote #4

new iRandomSprite = sprExplode[ random( sizeof sprExplode ) ];
__________________
xPaw is offline
jc980
Veteran Member
Join Date: Jan 2010
Location: God is with us...
Old 05-03-2011 , 08:54   Re: [Question] More Than One Sprite In A G_Variable
Reply With Quote #5

Quote:
Originally Posted by xPaw View Post
new iRandomSprite = sprExplode[ random( sizeof sprExplode ) ];
thanks! i tried random_num before, which didnt. when i used this works!
__________________
jc980 is offline
HBxander
Senior Member
Join Date: Jan 2011
Location: Behind you!
Old 05-03-2011 , 09:26   Re: [Question] More Than One Sprite In A G_Variable
Reply With Quote #6

Quote:
Originally Posted by xPaw View Post
new iRandomSprite = sprExplode[ random( sizeof sprExplode ) ];
+1 <3 :]
__________________
Selling:

- PointMod for Hide And Seek - $20
- Private BlockMaker with Weapon Block And More - $50
- Achievements ( FFA GamePlay ) - $25

PM Me about Private Work!
HBxander is offline
jc980
Veteran Member
Join Date: Jan 2010
Location: God is with us...
Old 05-03-2011 , 09:55   Re: [Question] More Than One Sprite In A G_Variable
Reply With Quote #7

havent tested it yet, but it compiled properly.

for question #2. anyone?

if someone answers this correctly, I'll Can Die Happily!
__________________
jc980 is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 05-03-2011 , 10:22   Re: [Question] More Than One Sprite In A G_Variable
Reply With Quote #8



PHP Code:
new zp_cso_respawnsprite[3][] = {"bla""bla""bla"}
new 
zp_cso_respawnspr[3// must be same size!

for (0sizeof zp_cso_respawnspritei++)  
              
zp_cso_respawnspr[i] = engfunc(EngFunc_PrecacheModelzp_cso_respawnsprite[i]) 
__________________


Last edited by SonicSonedit; 05-03-2011 at 10:25.
SonicSonedit is offline
jc980
Veteran Member
Join Date: Jan 2010
Location: God is with us...
Old 05-03-2011 , 10:29   Re: [Question] More Than One Sprite In A G_Variable
Reply With Quote #9

Quote:
Originally Posted by SonicSonedit View Post


PHP Code:
new zp_cso_respawnsprite[3][] = {"bla""bla""bla"}
new 
zp_cso_respawnspr[3// must be same size!

for (0sizeof zp_cso_respawnspritei++)  
              
zp_cso_respawnspr[i] = engfunc(EngFunc_PrecacheModelzp_cso_respawnsprite[i]) 
oh god! thanks!
__________________
jc980 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-03-2011 , 18:21   Re: [Question] More Than One Sprite In A G_Variable
Reply With Quote #10

Quote:
Originally Posted by SonicSonedit View Post


PHP Code:
new zp_cso_respawnsprite[3][] = {"bla""bla""bla"}
new 
zp_cso_respawnspr[3// must be same size!

for (0sizeof zp_cso_respawnspritei++)  
              
zp_cso_respawnspr[i] = engfunc(EngFunc_PrecacheModelzp_cso_respawnsprite[i]) 
Use sizeof(zp_cso_respawnsprite) when declaring the size of zp_cso_respawnspr[].
__________________
fysiks is offline
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 04:26.


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