making toll gates
#1

im planning to make one but my script doesnt work

can i have a basic script ?
Reply
#2

what you mean with toll gates ?

open / close commands
or
open cmd and auto close
or
automatic open and close
Reply
#3

open cmd with autoclose and get the players money
Reply
#4

Did you even start mapping them ?

You'll need CreateObject, MoveObject, and IsPlayerInRangeOfPoint.
Reply
#5

i got my script now but i have one problem, on how to get the player money $100 and how to make it money you dont have enough money to pay?

here is the code

Код:
public OnFilterScriptInit()
{
   Gate = CreateObject(3578, 61.125434, 1525.500000, 4.939503, 0.0, 0.0, 80, 100.0);
   return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
   if(!strcmp(cmdtext, "/paytoll", true)){
       if(IsPlayerInRangeOfPoint(playerid, 15.0, 61.125434, 1525.500000, 4.939503)){
           SetTimerEx("CloseGate", 7000, false, "i", playerid);
           MoveObject(Gate, 61.125434, 1525.500000, 2.939503, 3.0);
           SetObjectRot(Gate, 0.0, 0.0, 80);
           return SendClientMessage(playerid, blue, "Welcome! Thank You For Paying. Have a good day");
       }
   }
   return 0;
}

forward CloseGate(playerid);
public CloseGate(playerid)
{
   MoveObject(Gate, 61.125434, 1525.500000, 4.939503, 3.0);
   SetObjectRot(Gate, 0.0, 0.0, 80);
   return SendClientMessage(playerid, 0xFFFFFFFF, "");
}
Reply
#6

USE GET PLAYER MONEY FUNCTION !
Reply
#7

why my gate is not moving? i already /paytoll, im in range uhmm.. what is the prob?
Reply
#8

i got a new code, i cant get it work too
Код:
// Area 51 Toll
// Mapped by Lanzmeister
// Scripted by Tom.1412
// Don't remove credits
#include <a_samp>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
#endif
new Gate;
new Gatepick;
public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print("  Bridge Toll ");
	print(" Mapped & Scripted by KissOfDeath ");
	print(" Tested By Kyle ");
	print(" Don't remove credits ");
	print("--------------------------------------\n");
	CreateObject(3881, 63.633956, -1533.029418, 5.795578, 0.000000, 0.000000, 260.000000);
	CreateObject(984, 53.772052, -1534.311401, 4.794958, 0.000000, 0.000000, 83.000000);
	CreateObject(3881, 39.065982, -1530.223388, 6.007297, 0.000000, 0.000000, 80.000000);
	CreateObject(984, 48.075714, -1533.556274, 4.737607, 0.000000, 0.000000, 83.000000);
	CreateObject(984, 54.540885, -1529.424560, 4.855791, 0.000000, 0.000000, 82.000000);
	CreateObject(984, 48.902339, -1528.608276, 4.921133, 0.000000, 0.000000, 81.000000);
	CreateObject(2921, 64.125015, -1530.885498, 7.080554, 0.000000, 0.000000, 230.000000);
	CreateObject(2921, 36.825981, -1532.045288, 7.252584, 0.000000, 0.000000, 50.000000);
	CreateObject(9833, 49.918548, -1531.509277, 5.316796, 0.000000, 0.000000, 0.000000);
	CreateObject(1215, 36.236274, -1532.160644, 5.022241, 0.000000, 0.000000, 0.000000);
	CreateObject(997, 35.790390, -1542.055297, 4.235725, 0.000000, 0.000000, 90.000000);
	CreateObject(997, 35.742259, -1543.203247, 4.249802, 0.000000, 0.000000, 90.000000);
	CreateObject(997, 35.790420, -1542.029174, 4.950067, 0.000000, 0.000000, 90.000000);
	CreateObject(997, 35.851589, -1543.205566, 4.947018, 0.000000, 0.000000, 90.000000);
	Gate = CreateObject(968, 36.334384, -1531.915771, 5.162815, 0.000000, -90.000000, 86.000000);
	Gatepick = CreatePickup(1318, 14, 32.1509,-1535.6411,5.0823, -1);
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == Gatepick) SetTimer("Gateopen1", 0, false);
	return 1;
}

forward Gateopen1();
public Gateopen1()
{
    DestroyObject(Gate);
	Gate = CreateObject(968, 36.334384, -1531.915771, 5.162815, 0.000000, -90.000000, 86.000000);
	SetTimer("Gateopen2", 500, false);
	return 1;
}

forward Gateopen2();
public Gateopen2()
{
    DestroyObject(Gate);
	Gate = CreateObject(968, 36.334384, -1531.915771, 5.562815, 0.000000, -72.000000, 92.000000);
	SetTimer("Gateopen3", 500, false);
	return 1;
}

forward Gateopen3();
public Gateopen3()
{
    DestroyObject(Gate);
	Gate = CreateObject(968, 36.334384, -1531.915771, 5.562815, 0.000000, -68.000000, 92.000000);
	SetTimer("Gateclose1", 3000, false);
	return 1;
}

forward Gateclose1();
public Gateclose1()
{
    DestroyObject(Gate);
	Gate = CreateObject(968, 36.334384, -1531.915771, 5.562815, 0.000000, -68.000000, 92.000000);
	SetTimer("Gateclose2", 500, false);
	return 1;
}

forward Gateclose2();
public Gateclose2()
{
    DestroyObject(Gate);
	Gate = CreateObject(968, 36.334384, -1531.915771, 5.562815, 0.000000, -72.000000, 92.000000);
	SetTimer("Gateclose3", 500, false);
	return 1;
}

forward Gateclose3();
public Gateclose3()
{
    DestroyObject(Gate);
	Gate = CreateObject(968, 36.334384, -1531.915771, 5.162815, 0.000000, -90.000000, 86.0000);
	Gatepick = CreatePickup(1318, 14, 32.1509,-1535.6411,5.0823, -1);
	return 1;
}
one problem, the pickup doesnt show
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)