Raised This Month: $ Target: $400
 0% 

undefined symbol "id"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Belsebub
Senior Member
Join Date: Feb 2005
Location: Sweden
Old 04-13-2005 , 10:34   undefined symbol "id"
Reply With Quote #1

right now im working on a hidden mod request from Gangsta Bear and i need some help,

when i compile i get lots of undefined symbol "id" errors

this is the part of code i get the errors on:

Code:
 public StartRound() {     new team     cs_get_user_team(id)     new players     get_playersnum(0)     new iPlayers[32], iNum     get_players( iPlayers, iNum )     if (HiddenCount == 0 && players >= 3) {         id = iPlayers[ random_num(0, iNum-1) ]         Hidden[id] = true         HiddenCount++         return PLUGIN_CONTINUE         } else if (Hidden[id] == true && team == 1) {             cs_set_user_team(id, CS_TEAM_CT, CS_CT_GIGN)             return PLUGIN_CONTINUE         } else if (IRIS[id] == true && team == 2){             cs_set_user_team(id, CS_TEAM_T, CS_T_ARCTIC)             return PLUGIN_CONTINUE             } }


if anyone can help me tell me what to change and why so i will learn to next time
Belsebub is offline
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 04-13-2005 , 10:39  
Reply With Quote #2

you first have to do new id
but i think it's better that you choose another string
__________________
- Bye bye!
nightscreem is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-13-2005 , 14:49  
Reply With Quote #3

Code:
public StartRound(id) {      // .. } // OR- public StartRound() {     new id     // .. }
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 04-13-2005 , 22:04   hmm also
Reply With Quote #4

also, use:
Code:
new CsTeams:team = cs_get_user_team(id);
then you can try something like:
Code:
if(team == CS_TEAM_T) {     // add code here } else if(team == CS_TEAM_CT) {     // add code here }
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-13-2005 , 22:25  
Reply With Quote #5

If you are calling this function from other function then you have to pass id to your start round function

public StartRound(id) instead of public StartRound()
__________________
Bugsy is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-13-2005 , 22:40   Re: hmm also
Reply With Quote #6

Quote:
Originally Posted by knekter
also, use:
Code:
new CsTeams:team = cs_get_user_team(id);
then you can try something like:
Code:
if(team == CS_TEAM_T) {     // add code here } else if(team == CS_TEAM_CT) {     // add code here }
LOL, somehow I totally forgot about that a few minutes ago while I was writing some code.. I used new team = cs_get_user_team(id). Total brainfart.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
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 09:53.


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