buttons wont work
#1

Buttons won't work.

They are created, assigned a function but yet they wont work ingame.
Why?
Reply
#2

Well, first of all, by button, i'm assuming you mean textdraw. Second, how can anyone help you if you don't post your code?
Reply
#3

pawn Код:
public OnPlayerPressButton(playerid, buttonid)
{
    if(buttonid == lockdownbutton)
    {
        new iGroupID = PlayerInfo[playerid][pMember];
        if(PlayerInfo[playerid][pRank] >= arrGroupData[iGroupID][g_iCrateIsland])
        {
            new string[128];
            if(IslandGateStatus == 0)
            {
                MoveDynamicObject(IslandGate, -1083.90002441,4289.70019531,7.59999990, 0.3);
                foreach(new i: Player)
                {
                    if(IsPlayerInRangeOfPoint(i, 500, -1083.90002441,4289.70019531,7.59999990))
                    {
                        SendClientMessageEx(i, COLOR_YELLOW, " UNAUTHORISED INTRUDERS!! LOCKDOWN SEQUENCE INITIATED!!");
                    }
                }
                format(string, sizeof(string), "** %s has initiated a lockdown sequence at the San Andreas Military Island. **", GetPlayerNameEx(playerid));
                SendFamilyMessage(iGroupID, DEPTRADIO, string);
                IslandGateStatus = gettime();
                IslandThreatElimTimer = SetTimer("IslandThreatElim", 1800000, 0);
            }
            else
            {
                KillTimer(IslandThreatElimTimer);
                IslandThreatElim();
            }
        }
        else
        {
            SendClientMessageEx(playerid, COLOR_GRAD2, " Only the SAAS has the authority to do this! ");
        }
        return 1;
    }
        return 1;
}
There is code for one button.

It's created:
pawn Код:
lockdownbutton = CreateButton(-1121.70, 4290.41, 4.88, 180.00);
but when pressed, it does nothing.
Reply
#4

pawn Код:
public OnPlayerPressButton(playerid, buttonid)
{
    if(buttonid == lockdownbutton)
    {
        new iGroupID = PlayerInfo[playerid][pMember];
        if(PlayerInfo[playerid][pRank] >= arrGroupData[iGroupID][g_iCrateIsland])
        {
            new string[128];
            if(IslandGateStatus == 0)
            {
                MoveDynamicObject(IslandGate, -1083.90002441,4289.70019531,7.59999990, 0.3);
                foreach(new i: Player)
                {
                    if(IsPlayerInRangeOfPoint(i, 500, -1083.90002441,4289.70019531,7.59999990))
                    {
                        SendClientMessageEx(i, COLOR_YELLOW, " UNAUTHORISED INTRUDERS!! LOCKDOWN SEQUENCE INITIATED!!");
                    }
                }
                format(string, sizeof(string), "** %s has initiated a lockdown sequence at the San Andreas Military Island. **", GetPlayerNameEx(playerid));
                SendFamilyMessage(iGroupID, DEPTRADIO, string);
                IslandGateStatus = gettime();
                IslandThreatElimTimer = SetTimer("IslandThreatElim", 1800000, 0);
            }
            else
            {
                KillTimer(IslandThreatElimTimer);
                IslandThreatElim();
            }
        }
        else
        {
            SendClientMessageEx(playerid, COLOR_GRAD2, " Only the SAAS has the authority to do this! ");
        }
        return 1;
    }
Try return 1 only once, not twice
Reply
#5

Quote:
Originally Posted by Josh_Main
Посмотреть сообщение
pawn Код:
public OnPlayerPressButton(playerid, buttonid)
{
    if(buttonid == lockdownbutton)
    {
        new iGroupID = PlayerInfo[playerid][pMember];
        if(PlayerInfo[playerid][pRank] >= arrGroupData[iGroupID][g_iCrateIsland])
        {
            new string[128];
            if(IslandGateStatus == 0)
            {
                MoveDynamicObject(IslandGate, -1083.90002441,4289.70019531,7.59999990, 0.3);
                foreach(new i: Player)
                {
                    if(IsPlayerInRangeOfPoint(i, 500, -1083.90002441,4289.70019531,7.59999990))
                    {
                        SendClientMessageEx(i, COLOR_YELLOW, " UNAUTHORISED INTRUDERS!! LOCKDOWN SEQUENCE INITIATED!!");
                    }
                }
                format(string, sizeof(string), "** %s has initiated a lockdown sequence at the San Andreas Military Island. **", GetPlayerNameEx(playerid));
                SendFamilyMessage(iGroupID, DEPTRADIO, string);
                IslandGateStatus = gettime();
                IslandThreatElimTimer = SetTimer("IslandThreatElim", 1800000, 0);
            }
            else
            {
                KillTimer(IslandThreatElimTimer);
                IslandThreatElim();
            }
        }
        else
        {
            SendClientMessageEx(playerid, COLOR_GRAD2, " Only the SAAS has the authority to do this! ");
        }
        return 1;
    }
Try return 1 only once, not twice
didnt work
Reply
#6

PHP код:
public OnPlayerPressButton(playeridbuttonid)
{
    if(
buttonid == lockdownbutton)
    {
        new 
iGroupID PlayerInfo[playerid][pMember];
        if(
PlayerInfo[playerid][pRank] >= arrGroupData[iGroupID][g_iCrateIsland])
        {
            new 
string[128];
            if(
IslandGateStatus == 0)
            {
                
MoveDynamicObject(IslandGate, -1083.90002441,4289.70019531,7.599999900.3);
                foreach(new 
iPlayer)
                {
                    if(
IsPlayerInRangeOfPoint(i500, -1083.90002441,4289.70019531,7.59999990))
                    {
                        
SendClientMessage(iCOLOR_YELLOW" UNAUTHORISED INTRUDERS!! LOCKDOWN SEQUENCE INITIATED!!");
                    }
                }
                
format(stringsizeof(string), "** %s has initiated a lockdown sequence at the San Andreas Military Island. **"GetPlayerName(playerid));
                
SendFamilyMessage(iGroupIDDEPTRADIOstring);
                
IslandGateStatus gettime();
                
IslandThreatElimTimer SetTimer("IslandThreatElim"18000000);
            }
            else
            {
                
KillTimer(IslandThreatElimTimer);
                
IslandThreatElim();
            }
        }
        else
        {
            
SendClientMessage(playeridCOLOR_GRAD2" Only the SAAS has the authority to do this! ");
        }
        return 
1;
    } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)