AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Running functions with custon paramaters... (https://forums.alliedmods.net/showthread.php?t=10036)

TotalNoobScripter 02-06-2005 14:48

Running functions with custon paramaters...
 
Why wont this work? The function is executed with:
Code:
interactwithfakeciv(id , npcid[id])

and the function is loaded like this:
Code:
public interactwithfakeciv(id , npcid[id] ) {

npcid[id] is an global int.


I already fixed this by doing it a different way, but i would still like to know why this wouldn't work?

XxAvalanchexX 02-06-2005 16:27

Code:
public interactwithfakeciv(id , npcid ) {
instead.

TotalNoobScripter 02-06-2005 17:50

you cant use arrays for function paramaters? dam.

XxAvalanchexX 02-06-2005 18:17

You can, but you assigned its required length as "id", which I don't believe was defined.

BlueRaja 02-06-2005 18:19

You can; but they have to be static.

Since ids only range from 0-31, try
npcid[32]
instead (unless npcid is supposed to be a single id, in which case you'd use a normal variable...).
[edit] Damn you, beat me to it.

XxAvalanchexX 02-06-2005 18:32

ids range from 1-32.

Twilight Suzuka 02-06-2005 20:52

0 is the ID of the ded server console

BlueRaja 02-06-2005 20:56

Right, what did I say?

Twilight Suzuka 02-06-2005 20:58

Quote:

Originally Posted by XxAvalanchexX
ids range from 1-32.

Quote:

You can; but they have to be static.

Since ids only range from 0-31, try
npcid[32]
instead (unless npcid is supposed to be a single id, in which case you'd use a normal variable...).
[edit] Damn you, beat me to it.
ID's are 0-32, with 0 being dedicated server console, or taken up by metamod or its plugins if its listen.

XxAvalanchexX 02-06-2005 21:02

Quote:

Originally Posted by BlueRaja
Right, what did I say?

0-31


All times are GMT -4. The time now is 19:25.

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