[HELP] auto gate
#1

hi,

i have tryed and followed loads of helps of how to make a auto gate but they just dont work

iv got the hole gate set to work but not the auto help?

pawn Код:
#include <a_samp>
#include <streamer>
#define COLOR_BLUE1 0x0077dbff
#define COLOR_GREY 0xAFAFAFAA
#define FILTERSCRIPT
new Tollgate1;
forward GateClose();

   
public OnFilterScriptInit( )
{

    Tollgate1 = CreateObject(976, 2216.3156738281, -1142.8746337891, 24.80749130249, 0.0000, 0.0000, 342.13500976563);

    print( "\n[FS] *************************" );
    print( "[FS] * Tom1412 Toll system *" );
    print( "[FS] * Loaded ...            *" );
    print( "[FS] *************************\n" );
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp(cmdtext, "/openhgate", true)==0)
    {
        GivePlayerMoney(playerid,-5);
        MoveObject(Tollgate1,2225.5759277344, -1146.0582275391, 24.80749130249, 6.5);
        SetTimer("GateClose", 2000, 0);
        SendClientMessage(playerid, COLOR_BLUE1,"$5 payed \n have a nice day.");
        return 1;
    }

    return 0;
}

public GateClose()
{
    MoveObject (Tollgate1,2216.3156738281, -1142.8746337891, 24.80749130249, 3.5);
    return 1;
}
Reply
#2

http://pastebin.com/nN7Juuv4
Reply
#3

Thanx but i can't add GivePlayerMoney(playerid,-5);
to it on the auto gate section it?
Reply
#4

idk if itll work but


Код:
#include <a_samp>

#define COLOR_BLUE1 0x0077dbff
#define COLOR_GREY 0xAFAFAFAA

new Tollgate1;
new bool:Tollgate1Use;

forward GateClose();
forward GateAuto();

public OnFilterScriptInit( )
{

    Tollgate1 = CreateObject(976, 2216.3156738281, -1142.8746337891, 24.80749130249, 0.0000, 0.0000, 342.13500976563);

    print( "\n[FS] *************************" );
    print( "[FS] * Tom1412 Toll system *" );
    print( "[FS] * Loaded ...            *" );
    print( "[FS] *************************\n" );
    
    SetTimer("GateAuto",2000,1);
    return 1;
}

public OnFilterScriptExit()
{
	DestroyObject(Tollgate1);
    return 1;
}

public GateAuto()
{
	if(!Tollgate1Use)
	{
		for(new i; i<MAX_PLAYERS; i++)
		{
			if(IsPlayerInRangeOfPoint(i,20.0,2216.3156738281, -1142.8746337891, 24.80749130249))
			{
			if(Tollgate1Use != true)
			{
			Tollgate1Use = true;
			GivePlayerMoney(i,-5);
    			SetTimer("GateClose", 2000, 0);
     			MoveObject(Tollgate1,2225.5759277344, -1146.0582275391, 24.80749130249, 6.5);
			}
     			return 1;
			}
		}
	}
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp(cmdtext, "/openhgate", true)==0)
    {
        if(!Tollgate1Use)
        {
            Tollgate1Use = true;
            
	        GivePlayerMoney(playerid,-5);
	        SetTimer("GateClose", 2000, 0);
	        MoveObject(Tollgate1,2225.5759277344, -1146.0582275391, 24.80749130249, 6.5);
	        
	        SendClientMessage(playerid, COLOR_BLUE1,"$5 payed \n have a nice day.");
	        return 1;
		}
		return 1;
    }

    return 0;
}

public GateClose()
{
	Tollgate1Use = false;
    MoveObject (Tollgate1,2216.3156738281, -1142.8746337891, 24.80749130249, 3.5);
    return 1;
}
Reply
#5

nope but im just going to have to use a basic gate command
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)