settimer that i create dont working
#1

i create a command(/takeoff) that player can use this command after some time,but it's not working.
PHP код:
command(takeoffplayeridparams[])
{
if(
GetPlayerVehicleID(playerid) == Rustler1 ||
GetPlayerVehicleID(playerid) == Rustler2||
GetPlayerVehicleID(playerid) == Rustler6)
{
    if(
gTeam[playerid] == Axis)
    {
       if (
GetPlayerState(playerid) == 2)
        {
            new 
tmpcar GetPlayerVehicleID(playerid);
            
SetVehiclePos(tmpcar2431.6775,320.9064,33.3247);
            
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
            
HasTakeOff[playerid] =1;
            
SetTimer("TakeOffReset"1000*60*30);
        }
        else
        {
            
SetPlayerInterior(playerid,0);
            
SetPlayerPos(playerid,2431.6775,320.9064,33.3247);
        }
    }
}
else if(
gTeam[playerid] == Axis)
{
SendClientMessage(playeridRed"You Need to be in Rustler");
}
if(
HasTakeOff[playerid] == 1)
{
SendClientMessage(playeridGreen"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(tmpcar1121.6018,572.1331,20.6020);
            
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
            
HasTakeOff[playerid] =1;
            
SetTimer("TakeOffReset"1000*60*30);
        }
        else
        {
            
SetPlayerInterior(playerid,0);
            
SetPlayerPos(playerid,1121.6018,572.1331,20.6020);
        }
    }
}
else if(
gTeam[playerid] == Allied)
{
SendClientMessage(playeridRed"You Need to be in Rustler");
}
return 
1;

Reply
#2

Quote:
Originally Posted by marik1599
Посмотреть сообщение
it's not working.
Means what?
Reply
#3

it means that player can use this command a lot of time and no as i do in the command.
as you can see here
PHP код:
if(HasTakeOff[playerid] == 1

SendClientMessage(playeridGreen"Please wait before using /takeoff again."); 
return 
1
}
if(
gTeam[playerid] == Allied
    { 
       if (
GetPlayerState(playerid) == 2
        { 
            new 
tmpcar GetPlayerVehicleID(playerid); 
            
SetVehiclePos(tmpcar1121.6018,572.1331,20.6020); 
            
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0
            
HasTakeOff[playerid] =1
            
SetTimer("TakeOffReset"1000*60*30); 
        } 
        else 
        { 
            
SetPlayerInterior(playerid,0); 
            
SetPlayerPos(playerid,1121.6018,572.1331,20.6020); 
        } 
    } 

Reply
#4

Put it at top of command:

pawn Код:
command(takeoff, playerid, params[])
{
    if(HasTakeOff[playerid] == 1)
    {
        SendClientMessage(playerid, Green, "Please wait before using /takeoff again.");
        return 1;
    }
Reply
#5

tnx man it's working
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)