Raised This Month: $ Target: $400
 0% 

Simple question [Still need help :( ]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
usaexelent
Senior Member
Join Date: Nov 2009
Location: Lithuania
Old 06-25-2011 , 15:57   Simple question [Still need help :( ]
Reply With Quote #1

How to make that player on other round wouldn't be crysis?

This is my code (And please don't rip this code or my idea)
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <fun>


new VIEW_MODELKNIFE[]    = "models/CRYSMOD/c_v_knife.mdl" 
new VIEW_MODELAUG[]    = "models/CRYSMOD/c_v_aug.mdl"
new VIEW_MODELUSP[]    = "models/CRYSMOD/c_v_usp.mdl"
new PLAYER_MODELAUG[]    = "models/CRYSMOD/c_p_aug.mdl" 

new bool:Crysis33 ]; // Holder for whether player is Crysis or not


public plugin_precache()
{
    
precache_model(VIEW_MODELKNIFE);
    
precache_model(VIEW_MODELAUG); 
    
precache_model(VIEW_MODELUSP); 
    
precache_model(PLAYER_MODELAUG);
}

public 
plugin_init()
{
    
register_event"CurWeapon""Event_CurWeapon""be""1=1" ); // Register curweapon
    
register_logevent("GetCrysis"2"1=Round_Start"
    
register_clcmd("say /boost""GetCrysis")
}


public 
Event_CurWeaponid )
{
    if( !
is_user_aliveid ) || !Crysisid ] )
        return 
PLUGIN_CONTINUE;
    
    switch( 
get_user_weaponid ) )
    {
        case 
CSW_KNIFE:
        {
            
set_pevidpev_viewmodel2VIEW_MODELKNIFE); // set models
            
set_user_rendering(idkRenderFxGlowShell000kRenderTransAlpha0// set visibility
        
}
        case 
CSW_USP:
        {
            
set_pevidpev_viewmodel2VIEW_MODELUSP); // set models
        
}
        case 
CSW_AUG:
        {
            
set_pevidpev_viewmodel2VIEW_MODELAUG); // set models
            
set_pevidpev_weaponmodel2PLAYER_MODELAUG ); // set models
        
}
        default:
        {
        
set_user_rendering(id,kRenderFxNone,255,255,255,kRenderNormal,16); 
        }
    }
}

public 
GetCrysisid )
{
Crysis[id] = false;
new 
iPlayers32 ], iNum;
get_playersiPlayersiNum );
new 
iRand randomiNum ); // Get random player

CrysisiPlayersiRand ] ] = true// Set the array index to true

client_print(iRandprint_chat"You are Crysis now!"); 


Last edited by usaexelent; 06-27-2011 at 05:56.
usaexelent is offline
Send a message via Skype™ to usaexelent
usaexelent
Senior Member
Join Date: Nov 2009
Location: Lithuania
Old 06-25-2011 , 16:06   Re: Simple question
Reply With Quote #2

I Tried this:

public GetCrysis( id )
{
Crysis[id] = false; // This line
new iPlayers[ 32 ], iNum;
get_players( iPlayers, iNum );
new iRand = random( iNum ); // Get random player

Crysis[ iPlayers[ iRand ] ] = true; // Set the array index to true

client_print(iRand, print_chat, "You are Crysis now!");
}
usaexelent is offline
Send a message via Skype™ to usaexelent
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 06-25-2011 , 17:45   Re: Simple question
Reply With Quote #3

RoundStart logevent doesn't parse a "id", so you're basically always setting Crysis[0] = false
You don't need an entire array if there can be only 1 player at a time, just set a variable to the player id.
Also, I don't think you're getting random player ID right... since player IDs can have gaps... meaning, 4 players are in-game... and their entity ids can be: 1,2,5 and 16, but that get_players() returns 4, and you'll have only 1-4 range which will fk up your random player.


PS: I'm quite curious what you mean by "You are Crysis", that just sounds wrong.
The suit is named "nanosuit" and "Crysis" is "crisis" (search translation), Crytek likes to use their name in every game they make.
__________________

Last edited by Hunter-Digital; 06-25-2011 at 17:50.
Hunter-Digital is offline
usaexelent
Senior Member
Join Date: Nov 2009
Location: Lithuania
Old 06-26-2011 , 05:23   Re: Simple question
Reply With Quote #4

Could some one correct my mistakes because I don't know how to correct them.
usaexelent is offline
Send a message via Skype™ to usaexelent
2reason2kill
Senior Member
Join Date: Feb 2011
Old 06-26-2011 , 05:59   Re: Simple question
Reply With Quote #5

Quote:
Originally Posted by usaexelent View Post
Could some one correct my mistakes because I don't know how to correct them.
I think u must make the boolean False on round start.
2reason2kill is offline
usaexelent
Senior Member
Join Date: Nov 2009
Location: Lithuania
Old 06-26-2011 , 06:09   Re: Simple question [Still need help]
Reply With Quote #6

Thats what i did
usaexelent is offline
Send a message via Skype™ to usaexelent
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-26-2011 , 06:22   Re: Simple question [Still need help]
Reply With Quote #7

PHP Code:
#include <amxmodx> 
#include <fakemeta> 
#include <fun> 


new VIEW_MODELKNIFE[]    = "models/CRYSMOD/c_v_knife.mdl"  
new VIEW_MODELAUG[]    = "models/CRYSMOD/c_v_aug.mdl" 
new VIEW_MODELUSP[]    = "models/CRYSMOD/c_v_usp.mdl" 
new PLAYER_MODELAUG[]    = "models/CRYSMOD/c_p_aug.mdl"  

new bool:Crysis33 ]; // Holder for whether player is Crysis or not 


public plugin_precache() 

    
precache_model(VIEW_MODELKNIFE); 
    
precache_model(VIEW_MODELAUG);  
    
precache_model(VIEW_MODELUSP);  
    
precache_model(PLAYER_MODELAUG); 


public 
plugin_init() 

    
register_event"CurWeapon""Event_CurWeapon""be""1=1" ); // Register curweapon 
    
register_logevent("GetCrysis"2"1=Round_Start")  
    
register_clcmd("say /boost""GetCrysis"



public 
Event_CurWeaponid 

    if( !
is_user_aliveid ) || !Crysisid ] ) 
        return 
PLUGIN_CONTINUE
     
    switch( 
read_data(2) ) 
    { 
        case 
CSW_KNIFE
        { 
            
set_pevidpev_viewmodel2VIEW_MODELKNIFE); // set models 
            
set_user_rendering(idkRenderFxGlowShell000kRenderTransAlpha0// set visibility 
        

        case 
CSW_USP
        { 
            
set_pevidpev_viewmodel2VIEW_MODELUSP); // set models
            
set_user_rendering(id)
        } 
        case 
CSW_AUG
        { 
            
set_pevidpev_viewmodel2VIEW_MODELAUG); // set models 
            
set_pevidpev_weaponmodel2PLAYER_MODELAUG ); // set models
            
set_user_rendering(id)
        } 
        default: 
        { 
            
set_user_rendering(id);  
        } 
    } 


public 
GetCrysis( ) 
{
    
arrayset(Crysissizeof(Crysis), false);

    new 
iPlayers32 ], iNum
    
get_playersiPlayersiNum"h" ); 
    new 
iRand iPlayersrandomiNum ) ]; // Get random player 

    
CrysisiRand ] = true// Set the array index to true 

    
client_print(iRandprint_chat"You are Crysis now!");  

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
usaexelent
Senior Member
Join Date: Nov 2009
Location: Lithuania
Old 06-26-2011 , 06:50   Re: Simple question [Still need help]
Reply With Quote #8

It still doesn't work. On new round my skins doesn't change. That means that the Crysis array is still true and setarray didn't work. ;(
usaexelent is offline
Send a message via Skype™ to usaexelent
2reason2kill
Senior Member
Join Date: Feb 2011
Old 06-26-2011 , 08:31   Re: Simple question [Still need help]
Reply With Quote #9

Quote:
Originally Posted by usaexelent View Post
It still doesn't work. On new round my skins doesn't change. That means that the Crysis array is still true and setarray didn't work. ;(
I havent test This, I think i should work.

PHP Code:
#include <amxmodx> 
#include <fakemeta> 
#include <fun>
#include <hamsandwich>


new VIEW_MODELKNIFE[]    = "models/CRYSMOD/c_v_knife.mdl"  
new VIEW_MODELAUG[]    = "models/CRYSMOD/c_v_aug.mdl" 
new VIEW_MODELUSP[]    = "models/CRYSMOD/c_v_usp.mdl" 
new PLAYER_MODELAUG[]    = "models/CRYSMOD/c_p_aug.mdl"  

new bool:Crysis33 ]; // Holder for whether player is Crysis or not 


public plugin_precache() 

    
precache_model(VIEW_MODELKNIFE); 
    
precache_model(VIEW_MODELAUG);  
    
precache_model(VIEW_MODELUSP);  
    
precache_model(PLAYER_MODELAUG); 


public 
plugin_init() 

    
register_plugin("Someting","0.1","usaexelent");
    
register_event"CurWeapon""Event_CurWeapon""be""1=1" ); // Register curweapon 
    
register_logevent("GetCrysis"2"1=Round_Start")  
    
register_clcmd("say /boost""GetCrysis"
    
RegisterHam(Ham_Spawn"player""Player_Spawn_Post"1);



public 
Event_CurWeaponid 

    if( !
is_user_aliveid ) || !Crysisid ] ) 
        return 
PLUGIN_CONTINUE
     
    switch( 
read_data(2) ) 
    { 
        case 
CSW_KNIFE
        { 
            
set_pevidpev_viewmodel2VIEW_MODELKNIFE); // set models 
            
set_user_rendering(idkRenderFxGlowShell000kRenderTransAlpha0// set visibility 
        

        case 
CSW_USP
        { 
            
set_pevidpev_viewmodel2VIEW_MODELUSP); // set models
            
set_user_rendering(id)
        } 
        case 
CSW_AUG
        { 
            
set_pevidpev_viewmodel2VIEW_MODELAUG); // set models 
            
set_pevidpev_weaponmodel2PLAYER_MODELAUG ); // set models
            
set_user_rendering(id)
        } 
        default: 
        { 
            
set_user_rendering(id);  
        } 
    } 


public 
GetCrysis( ) 
{
    
arrayset(Crysissizeof(Crysis), false);

    new 
iPlayers32 ], iNum
    
get_playersiPlayersiNum"h" ); 
    new 
iRand iPlayersrandomiNum ) ]; // Get random player 

    
CrysisiRand ] = true// Set the array index to true 

    
client_print(iRandprint_chat"You are Crysis now!");  
}
public 
Player_Spawn_Post(id)
{
    
Crysis[id] = false;
}
public 
client_connect(id)
{
    
Crysis[id] = false;
}
public 
client_disconnect(id)
{
    
Crysis[id] = false;

If somthing is Wrong Plz Correct me!
2reason2kill is offline
usaexelent
Senior Member
Join Date: Nov 2009
Location: Lithuania
Old 06-26-2011 , 09:34   Re: Simple question [Still need help]
Reply With Quote #10

It works ! Thank you. When i finish this plugin your going to be in my credit list

Last edited by usaexelent; 06-26-2011 at 09:38.
usaexelent is offline
Send a message via Skype™ to usaexelent
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 23:32.


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