20.07.2012, 12:45
Hey guys,
Im making a toll-system that opens the gate with ''/toll'' and closing automaticly after severeal sec. No I have 2 gates (for both sides of the road) and I want to open both tolls with ''/toll'' the commands are checking if player is in range, but I can only use 1 gate....
Here the piece of my script for the command:
Hope you know what I can do..
Mayebe I have to do:
else if PlayeInRangeOfPoitnt (the other gate)
opens that gate ?
Im making a toll-system that opens the gate with ''/toll'' and closing automaticly after severeal sec. No I have 2 gates (for both sides of the road) and I want to open both tolls with ''/toll'' the commands are checking if player is in range, but I can only use 1 gate....
Here the piece of my script for the command:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/toll", true))
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1806.19921875, 926.7998046875, 8.3000001907349))
{
if(GetPlayerWantedLevel(playerid) > 3)
{
new tmp[64];
format(tmp, sizeof(tmp), "Your current wanted level is: %i you cannot pass the toll! Find another way!", GetPlayerWantedLevel(playerid));
SendClientMessage(playerid, 0xFF0000FF, tmp);
}
else
{
SetTimerEx("CloseGate", 3000, false, "i", playerid);
SetPVarInt(playerid, "PVarMoney", -50);
MoveObject(Gate, 1806.1999511719, 926.79998779297, 8.3000001907349, 3.0, 0.0, 359.25, 0.0);
SendClientMessage(playerid, 0x006EFFFF, "You paid toll, you are ready to go!");
}
}
return 1;
}
return 0;
}
Mayebe I have to do:
else if PlayeInRangeOfPoitnt (the other gate)
opens that gate ?