It compiles fine but if i go in my server i go to the pickup to pay 100 the barrier wont go open, this is the script:
Код:
new BoothNDirNGate;
new BoothNDirSGate;
new BoothSDirSGate;
new BoothSDirNGate;
new BoothNDirNPickup;
new BoothNDirSPickup;
new BoothSDirSPickup;
new BoothSDirNPickup;
forward BoothNDirNGateClose();
forward BoothNDirSGateClose();
forward BoothSDirSGateClose();
forward BoothSDirNGateClose();
//Objects
CreateObject(9623, 1793.594360, 687.474426, 17.282511, 0.0000, 0.0000, 351.3283);
CreateObject(9623, 1775.710815, 690.203857, 17.281092, 0.0000, 0.0000, 351.3283);
CreateObject(966, 1782.730225, 685.345886, 15.285233, 0.0000, 0.0000, 348.7500);
CreateObject(966, 1773.754150, 686.950195, 15.282106, 0.0000, 0.0000, 348.7500);
CreateObject(968, 1773.841919, 686.946228, 16.216358, 0.0000, 268.0403, 348.7500);
CreateObject(968, 1782.843140, 685.346069, 16.133198, 0.0000, 268.0403, 348.7500);
CreateObject(966, 1793.972412, 697.319824, 14.370026, 0.0000, 0.0000, 348.7500);
CreateObject(966, 1802.745972, 695.731323, 14.365092, 0.0000, 0.0000, 348.7500);
CreateObject(968, 1802.875244, 695.741699, 15.224345, 0.0000, 268.0403, 348.7499);
CreateObject(968, 1794.030762, 697.280396, 15.261672, 0.0000, 268.0403, 348.7499);
//Pickups
BoothNDirNPickup = CreatePickup(1274,14,1779.7521,689.9738,16.0389);
BoothNDirSPickup = CreatePickup(1274,14,1771.5936,693.0703,15.9372);
BoothSDirSPickup = CreatePickup(1274,14,1788.7377,688.6647,16.0134);
BoothSDirNPickup = CreatePickup(1274,14,1797.8378,688.8030,15.9129);
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == BoothNDirNPickup)
{
if(GetPlayerMoney(playerid) < 100) GameTextForPlayer(playerid,"~r~You need $100!",3000,4);
else
{
SetObjectRot(BoothNDirNGate,0.0,0.0,0.0);
SetTimer("BoothNDirNGateClose",7000,0);
}
}
else if(pickupid == BoothNDirSPickup)
{
if(GetPlayerMoney(playerid) < 100) GameTextForPlayer(playerid,"~r~You need $100!",3000,4);
else
{
GivePlayerMoney(playerid,-100);
GameTextForPlayer(playerid,"~g~Toll paid, you may enter the bridge!",3000,4);
SetObjectRot(BoothNDirSGate,0.0,-1.719,180.000);
SetTimer("BoothNDirSGateClose",7000,0);
}
}
else if(pickupid == BoothSDirSPickup)
{
if(GetPlayerMoney(playerid) < 100) GameTextForPlayer(playerid,"~r~You need $100!",3000,4);
else
{
SetObjectRot(BoothSDirSGate,0.0,-2.578,0.0);
SetTimer("BoothSDirSGateClose",7000,0);
}
}
else if(pickupid == BoothSDirNPickup)
{
if(GetPlayerMoney(playerid) < 100) GameTextForPlayer(playerid,"~r~You need $100!",3000,4);
else
{
GivePlayerMoney(playerid,-100);
GameTextForPlayer(playerid,"~g~Toll paid, you may enter the bridge!",3000,4);
SetObjectRot(BoothSDirNGate,0.0,-1.719,-180.000);
SetTimer("BoothSDirNGateClose",7000,0);
}
}
return 1;
}
public BoothNDirNGateClose() SetObjectRot(BoothNDirNGate,0.0,-91.100,0.0);
public BoothNDirSGateClose() SetObjectRot(BoothNDirSGate,0.0,-91.100,180.000);
public BoothSDirSGateClose() SetObjectRot(BoothSDirSGate,0.0,-91.100,0.0);
public BoothSDirNGateClose() SetObjectRot(BoothSDirNGate,0.0,-91.100,-180.000);
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == BoothNDirNPickup)
{
if(GetPlayerMoney(playerid) < 100) return GameTextForPlayer(playerid,"~r~You need $100!",3000,4);
}
else
{
SetObjectRot(BoothNDirNGate,0.0,0.0,0.0);
SetTimer("BoothNDirNGateClose",7000,0);
}
}
if(pickupid == BoothNDirSPickup)
{
if(GetPlayerMoney(playerid) < 100) return GameTextForPlayer(playerid,"~r~You need $100!",3000,4);
}
else
{
GivePlayerMoney(playerid,-100);
GameTextForPlayer(playerid,"~g~Toll paid, you may enter the bridge!",3000,4);
SetObjectRot(BoothNDirSGate,0.0,-1.719,180.000);
SetTimer("BoothNDirSGateClose",7000,0);
}
}
if(pickupid == BoothSDirSPickup)
{
if(GetPlayerMoney(playerid) < 100) return GameTextForPlayer(playerid,"~r~You need $100!",3000,4);
}
else
{
SetObjectRot(BoothSDirSGate,0.0,-2.578,0.0);
SetTimer("BoothSDirSGateClose",7000,0);
}
}
if(pickupid == BoothSDirNPickup)
{
if(GetPlayerMoney(playerid) < 100) return GameTextForPlayer(playerid,"~r~You need $100!",3000,4);
}
else
{
GivePlayerMoney(playerid,-100);
GameTextForPlayer(playerid,"~g~Toll paid, you may enter the bridge!",3000,4);
SetObjectRot(BoothSDirNGate,0.0,-1.719,-180.000);
SetTimer("BoothSDirNGateClose",7000,0);
}
}
return 1;
}