29.01.2019, 08:12
error 021: symbol already defined: "ishex"
error 021: symbol already defined: "OnObjectMoved"
and many errors in this one
PHP Code:
stock ishex(str[])
{
//P:3("ishex called: \"%s\"", str);
new
i,
cur;
if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X')) i = 2;
while (str[i])
{
cur = str[i++];
if (!(('0' <= cur <= '9') || ('A' <= cur <= 'F') || ('a' <= cur <= 'f'))) return 0;
//if ((cur < '0') || ('9' < cur < 'A') || ('F' < cur < 'a') || (cur > 'f')) return 0;
}
return 1;
}
PHP Code:
public OnObjectMoved(objectid)
{
for (new i = 0; i < MAX_BOOTHS; i ++) if (g_BoothUsed[i] && g_BoothObject[i] == objectid) {
DestroyObject(g_BoothObject[i]);
return SetTimerEx("UpdateBooth", 3000, false, "dd", Booth_GetPlayer(i), i);
}
if (objectid == A51NorthernGate)
{
// Check if the northern gate was closing
if (NorthernGateStatus == GATES_CLOSING)
{
// Set status flag for northern gates
NorthernGateStatus = GATES_CLOSED;
}
else
{
// Set status flag for northern gates
NorthernGateStatus = GATES_OPEN;
}
}
// Check if the object that moved was the eastern gate
else if (objectid == A51EasternGate)
{
// Check if the eastern gate was closing
if (EasternGateStatus == GATES_CLOSING)
{
// Set status flag for eastern gate
EasternGateStatus = GATES_CLOSED;
}
else
{
// Set status flag for eastern gate
EasternGateStatus = GATES_OPEN;
}
}
foreach(new i: Player)
{
if(objectid == gRocketObj[i])
{
new Float:x, Float:y, Float:z;
GetObjectPos(gRocketObj[i], x, y, z);
CreateExplosion(x, y, z, 11, 3.0);
DestroyObject(gRocketObj[i]);
}
}
return 1;
}
PHP Code:
forward OnPlayerPressButton(playerid, buttonid)
{
// New SASD interior.
for(new i = 0; i < sizeof(DocButton); i++) {
if (buttonid == DocButton[i]) {
if(IsLawEnforcement(playerid)) {
OpenDocAreaDoors(i, 1);
SetTimerEx("OpenDocAreaDoors", 5000, false, "ii", i, 0);
}
else {
SendClientMessageEx(playerid, COLOR_GREY, "Access denied");
break;
}
}
}
if(buttonid == DocCPButton[0] || buttonid == DocCPButton[1])
{
if(!IsLawEnforcement(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "Access denied");
ShowDocPrisonControls(playerid, 0);
}
return false;
}