AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   undefined symbol "id" (https://forums.alliedmods.net/showthread.php?t=12354)

Belsebub 04-13-2005 10:34

undefined symbol "id"
 
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 :D

nightscreem 04-13-2005 10:39

you first have to do new id
but i think it's better that you choose another string

v3x 04-13-2005 14:49

Code:
public StartRound(id) {      // .. } // OR- public StartRound() {     new id     // .. }

knekter 04-13-2005 22:04

hmm also
 
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 }

Bugsy 04-13-2005 22:25

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()

v3x 04-13-2005 22:40

Re: hmm also
 
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.


All times are GMT -4. The time now is 09:53.

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