afew errors... - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: afew errors... (
/showthread.php?tid=663361)
afew errors... -
NoorMustafa123 - 29.01.2019
error 021: symbol already defined: "ishex"
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;
}
error 021: symbol already defined: "OnObjectMoved"
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;
}
and many errors in this one
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;
}
Re: afew errors... -
Gforcez - 29.01.2019
Look at the error message, what do you think it means?
Re: afew errors... -
NoorMustafa123 - 29.01.2019
that its defined two times....
Re: afew errors... -
NoorMustafa123 - 29.01.2019
so what to do to fix that, also about the 3rd code
Re: afew errors... -
Nyzenic - 29.01.2019
You already have ishex & OnObjectMoved funcs/callbacks in your script. Find their duplicates and remove them.
Regarding the 3rd code, posting the error messages would help us find what's wrong faster.
Re: afew errors... -
fiki574 - 29.01.2019
For 1st and 2nd, check all of your includes and other filterscripts, there is a possibility that there are functions with same name already defined or not forwarded properly.
As for the 3rd error, replace "forward" with "public" and it should work.
Re: afew errors... -
NoorMustafa123 - 29.01.2019
fixed anyway