Raised This Month: $ Target: $400
 0% 

Player model[Help]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
usaexelent
Senior Member
Join Date: Nov 2009
Location: Lithuania
Old 06-24-2011 , 15:30   Player model[Help]
Reply With Quote #1

How to make that a random player would get different knife skin, and the others wouldn't?
usaexelent is offline
Send a message via Skype™ to usaexelent
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 06-24-2011 , 15:38   Re: Player model[Help]
Reply With Quote #2

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

new bool:g_bCustomSkin33 ]; // Holder for whether player gets a custom model or not

new g_szViewModel[ ] = ""// View model location
new g_szWeaponModel[ ] = ""// Weapon model location


public plugin_precache()
{
    
precache_modelg_szViewModel );
    
precache_modelg_szWeaponModel );
}

public 
plugin_init()
{
    
register_event"CurWeapon""Event_CurWeapon""be""1=1" ); // Register curweapon

    
register_clcmd"say /randomknife""CmdKnife" );
}


public 
Event_CurWeaponid )
{
    if( !
is_user_aliveid ) || !g_bCustomSkinid ] ) // If they aren't alive or they don't have a custom skin return
        
return PLUGIN_CONTINUE;
    
    if( 
get_user_weaponid ) == CSW_KNIFE // If weapon is a knife
    
{
        
set_pevidpev_viewmodel2g_szViewModel ); // set models
        
set_pevidpev_weaponmodel2g_szWeaponModel ); // set models
    
}
}

public 
CmdKnifeid )
{
    if( !( 
get_user_flagsid ) & ADMIN_BAN // If they don't have BAN flag return
        
return PLUGIN_HANDLED;
    
    new 
iPlayers32 ], iNum;
    
get_playersiPlayersiNum );
    
    new 
iRand randomiNum ); // Get random player
    
    
g_bCustomSkiniPlayersiNum ] ] = true// Set the array index to true

__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
2reason2kill
Senior Member
Join Date: Feb 2011
Old 06-24-2011 , 16:15   Re: Player model[Help]
Reply With Quote #3

Quote:
Originally Posted by nikhilgupta345 View Post
PHP Code:
#include <amxmodx>
#include <fakemeta>

new bool:g_bCustomSkin33 ]; // Holder for whether player gets a custom model or not

new g_szViewModel[ ] = ""// View model location
new g_szWeaponModel[ ] = ""// Weapon model location


public plugin_precache()
{
    
precache_modelg_szViewModel );
    
precache_modelg_szWeaponModel );
}

public 
plugin_init()
{
    
register_event"CurWeapon""Event_CurWeapon""be""1=1" ); // Register curweapon

    
register_clcmd"say /randomknife""CmdKnife" );
}


public 
Event_CurWeaponid )
{
    if( !
is_user_aliveid ) || !g_bCustomSkinid ] ) // If they aren't alive or they don't have a custom skin return
        
return PLUGIN_CONTINUE;
    
    if( 
get_user_weaponid ) == CSW_KNIFE // If weapon is a knife
    
{
        
set_pevidpev_viewmodel2g_szViewModel ); // set models
        
set_pevidpev_weaponmodel2g_szWeaponModel ); // set models
    
}
}

public 
CmdKnifeid )
{
    if( !( 
get_user_flagsid ) & ADMIN_BAN // If they don't have BAN flag return
        
return PLUGIN_HANDLED;
    
    new 
iPlayers32 ], iNum;
    
get_playersiPlayersiNum );
    
    new 
iRand randomiNum ); // Get random player
    
    
g_bCustomSkiniPlayersiNum ] ] = true// Set the array index to true

Can I Do Case?


Like

Case CSW_Somting.
2reason2kill is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-24-2011 , 16:19   Re: Player model[Help]
Reply With Quote #4

Quote:
Originally Posted by 2reason2kill View Post
Can I Do Case?


Like

Case CSW_Somting.
What do you mean?
__________________
fysiks is online now
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-24-2011 , 16:22   Re: Player model[Help]
Reply With Quote #5

Quote:
Originally Posted by 2reason2kill View Post
Can I Do Case?


Like

Case CSW_Somting.
Why are you hijacking another person's thread?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
2reason2kill
Senior Member
Join Date: Feb 2011
Old 06-24-2011 , 16:58   Re: Player model[Help]
Reply With Quote #6

Quote:
Originally Posted by Exolent[jNr] View Post
Why are you hijacking another person's thread?
I was Only asking a thing, Cuz I didnt want To Start a Other Thread about Models.
2reason2kill is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-24-2011 , 17:50   Re: Player model[Help]
Reply With Quote #7

Quote:
Originally Posted by 2reason2kill View Post
I was Only asking a thing, Cuz I didnt want To Start a Other Thread about Models.
You didn't ask about models. If your question is not directly about something already posted in this thread then it does not belong here.
__________________
fysiks is online now
usaexelent
Senior Member
Join Date: Nov 2009
Location: Lithuania
Old 06-24-2011 , 15:52   Re: Player model[Help]
Reply With Quote #8

i get errors

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Warning: Function "Event_CurWeapon" should return a value on line 34
Error: Expected token: ")", but found "return" on line 39
Error: Expected token: "}", but found "-end of file-" on line 46

2 Errors.
Could not locate output file C:\Documents and Settings\EasyNote\Desktop\plugin.amx (compile failed).




Last edited by usaexelent; 06-24-2011 at 15:54.
usaexelent is offline
Send a message via Skype™ to usaexelent
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-24-2011 , 16:09   Re: Player model[Help]
Reply With Quote #9

Add another parenthesis to the end of line 38.
__________________
fysiks is online now
usaexelent
Senior Member
Join Date: Nov 2009
Location: Lithuania
Old 06-24-2011 , 16:25   Re: Player model[Help]
Reply With Quote #10

The plugin doesn't work, when i write /randomknife nothing happens.

2reason2kill and dont mind him, every thing is ok if you need help witch involves this thread question then ok

Last edited by usaexelent; 06-24-2011 at 16:27.
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:25.


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