04.08.2011, 20:00
i create a command(/takeoff) that player can use this command after some time,but it's not working.
PHP код:
command(takeoff, playerid, params[])
{
if(GetPlayerVehicleID(playerid) == Rustler1 ||
GetPlayerVehicleID(playerid) == Rustler2||
GetPlayerVehicleID(playerid) == Rustler6)
{
if(gTeam[playerid] == Axis)
{
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, 2431.6775,320.9064,33.3247);
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
HasTakeOff[playerid] =1;
SetTimer("TakeOffReset", 1000*60*3, 0);
}
else
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,2431.6775,320.9064,33.3247);
}
}
}
else if(gTeam[playerid] == Axis)
{
SendClientMessage(playerid, Red, "You Need to be in Rustler");
}
if(HasTakeOff[playerid] == 1)
{
SendClientMessage(playerid, Green, "Please wait before using /takeoff again.");
return 1;
}
if(GetPlayerVehicleID(playerid) == Rustler3 ||
GetPlayerVehicleID(playerid) == Rustler4||
GetPlayerVehicleID(playerid) == Rustler5)
{
if(gTeam[playerid] == Allied)
{
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, 1121.6018,572.1331,20.6020);
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
HasTakeOff[playerid] =1;
SetTimer("TakeOffReset", 1000*60*3, 0);
}
else
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,1121.6018,572.1331,20.6020);
}
}
}
else if(gTeam[playerid] == Allied)
{
SendClientMessage(playerid, Red, "You Need to be in Rustler");
}
return 1;
}