Raised This Month: $ Target: $400
 0% 

random models without change team ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 03-12-2017 , 13:16   random models without change team ?
Reply With Quote #1

Hi.
I hope you are fine, geeks
my idea :
i want change model team whithout change the team

I will explain in short detail
I hope you understand me
first code :
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>


#define PLUGIN   "Test"
#define AUTHOR   "LetiLetiLepestok"
#define VERSION   "1.0"

new g_asModels[33][32]

public 
plugin_init()
{
   
register_plugin(PLUGINVERSIONAUTHOR)
   
register_forward(FM_SetClientKeyValue"SetClientKeyValue");
   
register_clcmd("set_model""set_player_mdl")
}


public 
set_player_mdl(player)
{
   new 
sModel[32]
   
read_argv(1sModelcharsmax(sModel))
   
trim(sModel)
   
remove_quotes(sModel)
   if(
equal(sModel""))
      
g_asModels[player] = ""

   
g_asModels[player] = sModel
   
   set_user_info
(player"model"g_asModels[player])   
   return 
PLUGIN_HANDLED
}


public 
SetClientKeyValue(player, const szInfoBuffer[], const szKey[], const szValue[])
{
   if( 
equal(szKey"model") && is_user_connected(player) && !equal(g_asModels[player], ""))
      return 
FMRES_SUPERCEDE

   
return FMRES_IGNORED

this its work without change team

but im using this function to chage team without killing the player for other case :
PHP Code:
set_user_team(id,"zombie",false,false
In the end :
I want to merge both cases into one job

so ! ( i need change team without killing and get the players this team random models )

PHP Code:
#define RANDOMSKINS 3

new g_asModels[33][32]


new const 
Set_Zombies_modelsRANDOMSKINS][] =
{
    
"red",
    
"clawler",
    
"blue"

__________________

Last edited by abdobiskra; 03-12-2017 at 13:18.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 03-12-2017 , 13:29   Re: random models without change team ?
Reply With Quote #2

Code:
set_user_info(player, "model", Set_Zombies_models[random(sizeof Set_Zombies_models)])
__________________

Last edited by edon1337; 03-12-2017 at 13:31.
edon1337 is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 03-12-2017 , 13:38   Re: random models without change team ?
Reply With Quote #3

Quote:
Originally Posted by edon1337 View Post
Code:
set_user_info(player, "model", random(sizeof Set_Zombies_models))
But I think they do not change the team .. only model? ( i dont test yet)
btw i need change the team and get random model for the players
ex:
i have two team ( zombies;humans ) ==> (infection mod)
im set all players to humans when joined to server .. so when any player infected should be to zombie team when im using this function
PHP Code:
set_user_team(id,"zombies",false,false
i want also get this players (mean when infected ) random models in the same team (zombies)
__________________

Last edited by abdobiskra; 03-12-2017 at 13:40.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 03-12-2017 , 13:48   Re: random models without change team ?
Reply With Quote #4

Obviously it only changes the model. A solution would be to create 2 Strings which will contain certain models from each team.

Code:
new const Human_Models[][] = { "model1", "model2" } new const Zombie_Models[][] = { "zm_model1", "zm_model2" }

Then you'd set the model by doing this

Code:
set_user_info( id, "model", get_user_team( id ) ? ( Zombies_Models[ random( sizeof Zombies_Models ) ] ) : ( Human_Models[ random( sizeof Human_Models ) ] ) )
__________________

Last edited by edon1337; 03-12-2017 at 13:51.
edon1337 is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 03-12-2017 , 14:12   Re: random models without change team ?
Reply With Quote #5

in SetClientKeyValue
We have forgotten these conditions ?
Quote:
!equal(g_asModels[player], ""))
How can it become?
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 03-12-2017 , 14:29   Re: random models without change team ?
Reply With Quote #6

Quote:
Originally Posted by abdobiskra View Post
in SetClientKeyValue
We have forgotten these conditions ?

How can it become?
What are you trying to do?
__________________
edon1337 is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 03-12-2017 , 15:13   Re: random models without change team ?
Reply With Quote #7

i mean this array should be to work for return the Key and operation goes above all others
we need it i think for change model without killing ?
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
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 18:00.


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