30.08.2011, 06:46
(
Последний раз редактировалось Kwarde; 30.08.2011 в 08:23.
)
Scripting is serverside, not clientside (CLIENT Support). This is in the wrong board. Also, please use a better defined title. This entire board (Client Support) is for help, so it's not needed to make topics named (and similar) "Help me". A better name would be "Undefined symbol". However, where did you place 'new gate2;'?. Here's an example:
Something like that should work. This won't work:
Why will this second way not work? - Because 'gate2' does now only exist in OnFilterScriptInit. It looks like this:
1- Filterscript is initialising
2- Create temporary variable named 'gate2' (well, PAWN doesn't use variables in .amx, but you get me I guess)
3- Set the value of 'gate2' to the new created object and create the object
4.1- Running OpenGate with integer 2
4.2- Check what the gate_id is. It is case, running the code on 'case 2'
4.3- Move Object 'gate2'. ERROR!! Gate2 does not exist in the OpenGate part. Problem!
5- Remove the variable 'gate2' and return 1 (OnFilterScriptInit again)
I hope that you understand that.
pawn Код:
#include <a_samp>
new gate2; //HERE
public OnFilterScriptInit()
{
gate2 = CreateObject(params);
OpenGate(2);
return 1;
}
stock OpenGate(gate_id)
{
switch(gate_id)
{
case 2: MoveObject(gate2, params);
default: return printf("ERROR: Gate %d does not exist", gate_id);
}
return 1;
}
pawn Код:
#include <a_samp>
public OnFilterScriptInit()
{
new gate2; //HERE
gate2 = CreateObject(params);
OpenGate(2);
return 1;
}
stock OpenGate(gate_id)
{
switch(gate_id)
{
case 2: MoveObject(gate2, params);
default: return printf("ERROR: Gate %d does not exist", gate_id);
}
return 1;
}
1- Filterscript is initialising
2- Create temporary variable named 'gate2' (well, PAWN doesn't use variables in .amx, but you get me I guess)
3- Set the value of 'gate2' to the new created object and create the object
4.1- Running OpenGate with integer 2
4.2- Check what the gate_id is. It is case, running the code on 'case 2'
4.3- Move Object 'gate2'. ERROR!! Gate2 does not exist in the OpenGate part. Problem!
5- Remove the variable 'gate2' and return 1 (OnFilterScriptInit again)
I hope that you understand that.