Help making timer here
#1

PHP код:
stock AutoOpenOrgGates(playerid)
{
    
SetTimerEx("AutoOpenOrgGate"3000true"i"playerid);

PHP код:
forward AutoOpenOrgGate(playerid);
public 
AutoOpenOrgGate(playerid)
{
    new 
donestr[265], name[MAX_PLAYER_NAME];
     
GetPlayerName(playeridnamesizeof(name));
    for(new 
idx=1idx<MAX_GATESidx++)
    {
        new 
Float:cur[3];
        if(
GateInfo[idx][gModel])
        {
            
GetDynamicObjectPos(GateInfo[idx][gGate], cur[0], cur[1], cur[2]);
            if(
IsPlayerInRangeOfPoint(playerid8cur[0], cur[1], cur[2]) || IsPlayerInRangeOfPoint(playerid8GateInfo[idx][gCX], GateInfo[idx][gCY], GateInfo[idx][gCZ]) || IsPlayerInRangeOfPoint(playerid8GateInfo[idx][gOX], GateInfo[idx][gOY], GateInfo[idx][gOZ]))
            {
                if(
GateInfo[idx][gOOwned] != 0)
                {
                    if(
GetPVarInt(playerid"playerorg") != 0)
                    {
                        
format(strsizeof(str), "org%d"GetPVarInt(playerid"playerorg"));
                         if(
GateInfo[idx][gOOwned]!= 0)
                         {
                            if(!
GateInfo[idx][gStatus])
                            {
                                
GateInfo[idx][gStatus] = 1;
                                
MoveDynamicObject(GateInfo[idx][gGate], GateInfo[idx][gOX], GateInfo[idx][gOY], GateInfo[idx][gOZ], GateInfo[idx][gSpeed], GateInfo[idx][gORX], GateInfo[idx][gORY], GateInfo[idx][gORZ]);
                                
SendClientMessage(playeridCOLOR_YELLOW,"Thanks for visiting in your org, the gate will close automatically");
                                break;
                            }
                        }
                        else {
                            
format(strsizeof(str), "This gate has been assigned to '%s' you cant open it."GateInfo[idx][gOOwned]);
                            
SendClientMessage(playeridCOLOR_WHITEstr);
                            break;
                        }
                    }
                    else {
                        
format(strsizeof(str), "This gate has been assigned to '%s' you cant open it."GateInfo[idx][gOOwned]);
                          
SendClientMessage(playeridCOLOR_WHITEstr);
                          break;
                    }
                }
            }
        }
    }
    return 
1;

hello please help me to make timer for closing this gates because this gates not closing after opened.
Reply
#2

You haven't got anything to close it in that script... Did you even make this, or where did it come from?

Код:
if(!GateInfo[idx][gStatus]) 
                            { 
                                GateInfo[idx][gStatus] = 1; 
                                MoveDynamicObject(GateInfo[idx][gGate], GateInfo[idx][gOX], GateInfo[idx][gOY], GateInfo[idx][gOZ], GateInfo[idx][gSpeed], GateInfo[idx][gORX], GateInfo[idx][gORY], GateInfo[idx][gORZ]); 
                                SetTimerEx(IN_HERE!);
                                SendClientMessage(playerid, COLOR_YELLOW,"Thanks for visiting in your org, the gate will close automatically"); 
                                break; 
                            }
In the middle of this is where you could have your closing gate timer.
Reply
#3

Done now i fixed it myself thanks for your help
Reply
#4

Where are those 2 segments? Did you make the script, or did you get the gate system from something else...
Reply
#5

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
Where are those 2 segments? Did you make the script, or did you get the gate system from something else...
Bro i just fixed them now its working
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)