01.10.2014, 12:35
Buttons won't work.
They are created, assigned a function but yet they wont work ingame.
Why?
They are created, assigned a function but yet they wont work ingame.
Why?
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;
}
lockdownbutton = CreateButton(-1121.70, 4290.41, 4.88, 180.00);
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;
}
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))
{
SendClientMessage(i, COLOR_YELLOW, " UNAUTHORISED INTRUDERS!! LOCKDOWN SEQUENCE INITIATED!!");
}
}
format(string, sizeof(string), "** %s has initiated a lockdown sequence at the San Andreas Military Island. **", GetPlayerName(playerid));
SendFamilyMessage(iGroupID, DEPTRADIO, string);
IslandGateStatus = gettime();
IslandThreatElimTimer = SetTimer("IslandThreatElim", 1800000, 0);
}
else
{
KillTimer(IslandThreatElimTimer);
IslandThreatElim();
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Only the SAAS has the authority to do this! ");
}
return 1;
}