Raised This Month: $ Target: $400
 0% 

How to use cs_get_user_team() and what is the name of a player entity?(ALMOST SOLVED)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 08-05-2008 , 17:44   How to use cs_get_user_team() and what is the name of a player entity?(ALMOST SOLVED)
Reply With Quote #1

1. How can I use the cs_get_user_team() function?(SOLVED)
I have tried doing the following:
PHP Code:
new CsInternalModel:PlrModel;
 
public 
my_func(id)
{
        new 
Team cs_get_user_team(idPlrModel);
        
// My code here...
        // bla bla bla....

But when I try to compile it says:
Code:
Warning: Tag mismatch on line 1080
(SOLVED)

2. What is the name of the player entitiy?(SOLVED)
For example, if I wanna use the FM_SetModel() function, that its parameters are:
Code:
FM_SetModel(ent, const szModel[])
What do I need to type in the "ent" parameter to get a player? (Problem solved, thanks to Peoples Army)

3. I am working on a basic plugin, and there are WAY too many lines in it for a plugin that does something that basic (setting up player's health, money and armor) and I just wanted to know the ways to make less lines and save memory... and causing less laggs... etc.

Thanks alot for any helpers! (+karma of course)
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ

Last edited by Dores; 08-06-2008 at 22:14. Reason: solved but more questions
Dores is offline
Peoples Army
SourceMod Donor
Join Date: Mar 2007
Old 08-05-2008 , 18:15   Re: How to set up a player's model and how is the player entity called?
Reply With Quote #2

ent is the index of an entity , a player is an entity , so the players index number would be used .
__________________
Peoples Army is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 08-05-2008 , 19:00   Re: How to set up a player's model and how is the player entity called?
Reply With Quote #3

Quote:
Originally Posted by Peoples Army View Post
ent is the index of an entity , a player is an entity , so the players index number would be used .
Ok, thanks alot. Now could you please try to answer my new question? I edited the main post. +karma
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
Peoples Army
SourceMod Donor
Join Date: Mar 2007
Old 08-05-2008 , 19:27   Re: How to use cs_get_user_team() and what is the name of a player entity?
Reply With Quote #4

the 2nd paramater of get_user_team is a string

Code:
new StoreTeamValue[32];
so you would use an array instead of a varaible , cuase your storing charchters , not a single digit or value
__________________
Peoples Army is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 08-05-2008 , 19:33   Re: How to use cs_get_user_team() and what is the name of a player entity?
Reply With Quote #5

Quote:
Originally Posted by Peoples Army View Post
the 2nd paramater of get_user_team is a string

Code:
 
new StoreTeamValue[32];
so you would use an array instead of a varaible , cuase your storing charchters , not a single digit or value
Thanks alot, though I managed to handle by simply using the fun module's function:
PHP Code:
get_user_team() //Instead of:
cs_get_user_team()    //Of cstrike module... 
But still thanks alot for the help! I +karma you...

Problem SOLVED but, I will let you know if there are any problems, so be ready to help me if I need, ok?
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
Peoples Army
SourceMod Donor
Join Date: Mar 2007
Old 08-05-2008 , 19:35   Re: How to use cs_get_user_team() and what is the name of a player entity?
Reply With Quote #6

lol np . K
__________________
Peoples Army is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-05-2008 , 21:43   Re: How to use cs_get_user_team() and what is the name of a player entity?
Reply With Quote #7

cs_get_user_team returns as "CsTeams", so declare the variable like "new CsTeams:Team". Then you have to set or check it using CS_TEAM_T, CS_TEAM_CT, etcetera. Or, you could use a regular variable, and convert the return result into an int: "new Team = _:cs_get_user_team(player)"

Peoples Army: The second argument to get_user_team is optional, it lets you get the team name (in addition to get_user_team returning the team number).
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Peoples Army
SourceMod Donor
Join Date: Mar 2007
Old 08-05-2008 , 21:45   Re: How to use cs_get_user_team() and what is the name of a player entity?
Reply With Quote #8

oh thats right , i just saw him using the 2nd paramater so i figured id tell him how to use it right
__________________
Peoples Army is offline
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 08-05-2008 , 21:46   Re: How to use cs_get_user_team() and what is the name of a player entity?
Reply With Quote #9

Or the fakemeta way...
new team = pev(id, pev_team)
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 08-05-2008 , 23:26   Re: How to use cs_get_user_team() and what is the name of a player entity?
Reply With Quote #10

Quote:
Originally Posted by XxAvalanchexX View Post
cs_get_user_team returns as "CsTeams", so declare the variable like "new CsTeams:Team". Then you have to set or check it using CS_TEAM_T, CS_TEAM_CT, etcetera. Or, you could use a regular variable, and convert the return result into an int: "new Team = _:cs_get_user_team(player)"

Peoples Army: The second argument to get_user_team is optional, it lets you get the team name (in addition to get_user_team returning the team number).
What do you mean the second argument is optional? I couldn't use cs_get_user_team() without it. :O
And besides, I wanted it to return the team's NAME not NUMBER.
So I did needed to use the second argument?
And where do I need to put Team after i did new CsTeams:Team in the get_user_team function?
by the way, to set its team, do i need to do this: new CsTeams:Team = CS_TEAM...?

Peoples Army: Thanks for the karma

Vet: I think i'll use that just incase issues might pop up using the fun/cstrike module... +karma
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores 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 05:40.


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