Need help with gate.
#2

pawn Код:
#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

new sdcb1g1;
new sdcb1g2;
new sdcb1g3;
new GatesClosed = 0;

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("\n--------------------------------------");
    print("--------------------------------------\n");
    sdcb1g1 = CreateObject(976,-394.6000100,1741.8000500,47.1000000,0.0000000,0.0000000,66.5000000);
    sdcb1g2 = CreateObject(976,-394.5996100,1742.0000000,41.0000000,0.0000000,0.0000000,65.9950000);
    sdcb1g3 = CreateObject(976,-394.7000100,1741.9000200,44.1000000,0.0000000,0.0000000,65.7450000);
    return 1;
}

public OnFilterScriptExit()
{
        return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print("\n----------------------------------");
    print("----------------------------------\n");
}

#endif

strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }
    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    new tmp[256];
    new cmd[256];
    new idx;
    cmd = strtok(cmdtext, idx);
    if (strcmp(cmd, "/sdcontactb1g1open", true) == 0)
    {
        MoveObject(sdcb1g1 ,-391.3999900,1749.1999500,47.1000000, 1.5);
        MoveObject(sdcb1g2 ,-391.3999900,1749.1999500,41.0000000, 1.5);
        MoveObject(sdcb1g3 ,-391.3999900,1749.1999500,44.1000000, 1.5);
        SendClientMessage(playerid,0x2C2727AA,"You have opened the base gates.");
        return 1;
    }
    if (strcmp(cmd, "/sdcontactb1g1close", true) == 0)
    {
        MoveObject(sdcb1g1 ,-394.6000100,1741.8000500,47.1000000, 1.5);
        MoveObject(sdcb1g2 ,-394.5996100,1742.0000000,41.0000000, 1.5);
        MoveObject(sdcb1g3 ,-394.7000100,1741.9000200,44.1000000, 1.5);
        SendClientMessage(playerid,0x2C2727AA,"You have closed the base gates.");
        return 1;
    }
    return 0;
}
Reply


Messages In This Thread
Need help with gate. - by N00bKiller - 24.05.2013, 23:21
Re: Need help with gate. - by SilverKiller - 24.05.2013, 23:50
Re: Need help with gate. - by N00bKiller - 24.05.2013, 23:56

Forum Jump:


Users browsing this thread: 1 Guest(s)