AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem with IF and ELSE IF (https://forums.alliedmods.net/showthread.php?t=13766)

Stephen 05-28-2005 11:11

Problem with IF and ELSE IF
 
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.

v3x 05-30-2005 00:45

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.

Yuri 05-30-2005 00:49

LoLz @ Stephen. Unknown shoud be mad at you for asking for help on the same subject, you actualy got It.

Unknown 05-30-2005 00:50

:(

Yuri 05-30-2005 00:51

LoL11one

v3x 05-30-2005 00:53

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

TROLL

Yuri 05-30-2005 00:56

Notice we stopped posting?, so be quiet.


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

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