[HELP] Please Help me!!!
#8

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:

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;
}
Something like that should work. This won't work:
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;
}
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.
Reply


Messages In This Thread
[HELP] Please Help me!!! - by uldissUP - 28.08.2011, 22:06
Re: [HELP] Please Help me!!! - by Ironboy - 29.08.2011, 20:41
Re: [HELP] Please Help me!!! - by uprp - 29.08.2011, 20:54
Re: [HELP] Please Help me!!! - by =WoR=G4M3Ov3r - 29.08.2011, 21:41
Re: [HELP] Please Help me!!! - by [P4] - 29.08.2011, 21:57
Re: [HELP] Please Help me!!! - by a_big - 30.08.2011, 02:40
Re: [HELP] Please Help me!!! - by =WoR=Varth - 30.08.2011, 02:52
Re: [HELP] Please Help me!!! - by Kwarde - 30.08.2011, 06:46

Forum Jump:


Users browsing this thread: 1 Guest(s)