Raised This Month: $ Target: $400
 0% 

Problem with IF and ELSE IF


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Stephen
Senior Member
Join Date: Aug 2004
Old 05-28-2005 , 11:11   Problem with IF and ELSE IF
Reply With Quote #1

Quote:
public ssj2_descend(id)
{
new currentPowerlevel = get_pdata_int(id, XXX );
remove_entity(avatar[id]);
entity_set_int ( id, EV_INT_rendermode, kRenderNormal );
entity_set_float ( id, EV_FL_renderamt, 255.0 );
set_pdata_int(id, XXX, currentPowerlevel / 2 )
set_pdata_int(id, XXX, currentPowerlevel / 2 )
return 1;
}
Playerclass is 3 and there is an Avatar layed over and player is notseeable now, cause the avatar hides it as an Modelreplacement.

now when i use the model replace ment and type ssj2_descend it works, EVERYTIME.

I want it work only when im using the create AVATAR and not the player.

so i thought something like this ?
Quote:
public ssj2_descend(id)
{
if ( avatar[id] !=0 )
{
new currentPowerlevel = get_pdata_int(id, XXX );
remove_entity(avatar[id]);
entity_set_int ( id, EV_INT_rendermode, kRenderNormal );
entity_set_float ( id, EV_FL_renderamt, 255.0 );
set_pdata_int(id, XXX, currentPowerlevel / 2 )
set_pdata_int(id, XXX, currentPowerlevel / 2 )
return 1;
}
else if ( entity_get_int( id, EV_INT_playerclass ) == 3 );
{
return 1;
}
Hope you understand what im trying to tell.
Stephen is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-30-2005 , 00:45  
Reply With Quote #2

Code:
new bool:avatar[32] = false public ssj2_descend(id) {     if ( avatar[id] ) {         new currentPowerlevel = get_pdata_int(id, XXX );         remove_entity(avatar[id]);         entity_set_int ( id, EV_INT_rendermode, kRenderNormal );         entity_set_float ( id, EV_FL_renderamt, 255.0 );         set_pdata_int(id, XXX, currentPowerlevel / 2 )         set_pdata_int(id, XXX, currentPowerlevel / 2 )         return 1;     }     else if ( entity_get_int( id, EV_INT_playerclass ) == 3 )         return 1; }
Should head you in the proper direction.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Yuri
Senior Member
Join Date: May 2005
Location: Yuri's Cyber Cafe
Old 05-30-2005 , 00:49  
Reply With Quote #3

LoLz @ Stephen. Unknown shoud be mad at you for asking for help on the same subject, you actualy got It.
Yuri is offline
Unknown
Junior Member
Join Date: May 2005
Old 05-30-2005 , 00:50  
Reply With Quote #4

Unknown is offline
Yuri
Senior Member
Join Date: May 2005
Location: Yuri's Cyber Cafe
Old 05-30-2005 , 00:51  
Reply With Quote #5

LoL11one
Yuri is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-30-2005 , 00:53  
Reply With Quote #6

Wow, quit posting crap that is off-topic. This isn't the proper forum for that.

TROLL
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Yuri
Senior Member
Join Date: May 2005
Location: Yuri's Cyber Cafe
Old 05-30-2005 , 00:56  
Reply With Quote #7

Notice we stopped posting?, so be quiet.
Yuri 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 16:35.


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