-
Sorompó cucchoz kerestem egy pwnt- azt próbáltam átírni kevesebb sikerrel!
ERROR:
C:\\Users\\ptR\\Desktop\\samp\\gamemodes\\Sorompo.pwn(28) : error 010: invalid function or declaration
C:\\Users\\ptR\\Desktop\\samp\\gamemodes\\Sorompo.pwn(32) : error 010: invalid function or declaration
C:\\Users\\ptR\\Desktop\\samp\\gamemodes\\Sorompo.pwn(40) : error 055: start of function body without function header
C:\\Users\\ptR\\Desktop\\samp\\gamemodes\\Sorompo.pwn(42) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
PAWN:
#include <a_samp>
#define FILTERSCRIPT
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xFF0000AA
forward GateClose();
new sorompo1;
new sorompo2;
public OnFilterScriptInit()
{
sorompo1 = CreateObject(968, -191.5, 1004.0999755859, 19.60000038147, 0, 90, 358.75); ///barrier closed
CreateObject(966,-215.39999390,1007.70001221,18.70000076,0.00000000,0.00000000,358.25000000); //object(bar_gatebar01) (2)
CreateObject(966,-191.39999390,1004.09997559,18.79999924,0.00000000,0.00000000,178.75000000); //object(bar_gatebar01) (3)
sorompo2 = CreateObject(968, -215.39999389648, 1007.700012207, 19.39999961853, 0, 270, 358.5); ///barrier closed
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(\"/rendornyit\", cmdtext, true, 10) == 0)
SetObjectRot(sorompo2, 0, 31, 358.75); // barrier open after command
SetTimer(\"GateClose\", 10000, 0);
SendClientMessage(playerid, COLOR_GREEN,\"A sorompó kinyilt! Hamarosan bezárodik (10mp).\");
return 1;
}
if (strcmp(\"/hatarnyit\", cmdtext, true, 10) == 0)
SetObjectRot(sorompo1, 0, 335, 358.5); // barrier open after command
SetTimer(\"GateClose\", 10000, 0);
SendClientMessage(playerid, COLOR_GREEN,\"A sorompó kinyilt! Hamarosan bezárodik (10mp).\");
return 1;
}
public GateClose()
{
SetObjectRot(sorompo1, 0, 90, 358.75); // barrier closed after command
return 1;
}
{
SetObjectRot(sorompo2, 0, 270, 358.5); // barrier closed after command
return 1;
}
-
Többi jó:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(\"/rendornyit\", cmdtext, true, 10) == 0)
{
SetObjectRot(sorompo2, 0, 31, 358.75); // barrier open after command
SetTimer(\"GateClose\", 10000, 0);
SendClientMessage(playerid, COLOR_GREEN,\"A sorompó kinyilt! Hamarosan bezárodik (10mp).\");
return 1;
}
if (strcmp(\"/hatarnyit\", cmdtext, true, 10) == 0)
{
SetObjectRot(sorompo1, 0, 335, 358.5); // barrier open after command
SetTimer(\"GateClose\", 10000, 0);
SendClientMessage(playerid, COLOR_GREEN,\"A sorompó kinyilt! Hamarosan bezárodik (10mp).\");
return 1;
}
return 0;
}
public GateClose()
{
SetObjectRot(sorompo1, 0, 90, 358.75); // barrier closed after command
return 1;
SetObjectRot(sorompo2, 0, 270, 358.5); // barrier closed after command
return 1;
}
-
Egy warning:
C:\\Users\\ptR\\Desktop\\samp\\gamemodes\\Sorompo.pwn(43) : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Warning.
A /rendornyit nem müködik nem zár vissza. Meg nem lehetne megcsinálni, hogy tényleg kinyiljon? mert csak igy kinyilik de csak siman \"valami\" amináció féle kéne! Köszönöm!
-
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(\"/rendornyit\", cmdtext, true, 10) == 0)
{
SetObjectRot(sorompo2, 0, 31, 358.75); // barrier open after command
SetTimer(\"GateClose\", 10000, 0);
SendClientMessage(playerid, COLOR_GREEN,\"A sorompó kinyilt! Hamarosan bezárodik (10mp).\");
return 1;
}
if (strcmp(\"/hatarnyit\", cmdtext, true, 10) == 0)
{
SetObjectRot(sorompo1, 0, 335, 358.5); // barrier open after command
SetTimer(\"GateClose\", 10000, 0);
SendClientMessage(playerid, COLOR_GREEN,\"A sorompó kinyilt! Hamarosan bezárodik (10mp).\");
return 1;
}
return 0;
}
public GateClose()
{
SetObjectRot(sorompo1, 0, 90, 358.75); // barrier closed after command
SetObjectRot(sorompo2, 0, 270, 358.5); // barrier closed after command
}
így?
-
Ja szerintem új jó, nem látok benne szembetûnõ {} és return hibát.
-
Tessék:
#include <a_samp>
#define FILTERSCRIPT
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xFF0000AA
forward GateClose();
forward GateOpen();
new sorompo1;
new sorompo2;
public OnFilterScriptInit()
{
sorompo1 = CreateObject(968, -191.5, 1004.0999755859, 19.60000038147, 0, 90, 358.75); ///barrier closed
CreateObject(966,-215.39999390,1007.70001221,18.70000076,0.00000000,0.00000000,358.25000000); //object(bar_gatebar01) (2)
CreateObject(966,-191.39999390,1004.09997559,18.79999924,0.00000000,0.00000000,178.75000000); //object(bar_gatebar01) (3)
sorompo2 = CreateObject(968, -215.39999389648, 1007.700012207, 19.39999961853, 0, 270, 358.5); ///barrier closed
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(\"/rendornyit\", cmdtext, true, 10) == 0)
{
SetObjectRot(sorompo2, 0, 31, 358.75); // barrier open after command
SetTimer(\"GateClose\", 10000, 0);
SendClientMessage(playerid, COLOR_GREEN,\"A sorompó kinyilt! Hamarosan bezárodik (10mp).\");
return 1;
}
if (strcmp(\"/hatarnyit\", cmdtext, true, 10) == 0)
{
SetObjectRot(sorompo1, 0, 335, 358.5); // barrier open after command
SetTimer(\"GateOpen\", 10000, 0);
SendClientMessage(playerid, COLOR_GREEN,\"A sorompó kinyilt! Hamarosan bezárodik (10mp).\");
return 1;
}
return 0;
}
public GateClose()
{
SetObjectRot(sorompo2, 0, 90, 358.75); // barrier closed after command
return 1;
}
public GateOpen()
{
SetObjectRot(sorompo1, 0, 270, 358.5); // barrier closed after command
return 1;
}
De nem teszteltem!
-
És ezekben látszik, hogy kinyilik meg becsukodik? vagy csak ki nyilik ki teremtõdik meg vissza?: D