Fail by error.. - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Fail by error.. (
/showthread.php?tid=170897)
Fail by error.. -
XCarBOn - 24.08.2010
It's an erro which i don't understand.
My script:
PHP код:
if (strcmp(cmd, "/goto", true) == 0)
{
new tmp[30];
tmp = strtok(cmdtext, idx);
new otherid;
otherid = strval(tmp);
if(UserStats[playerid][Admin] >= 2)
{
if(IsPlayerConnected(otherid) && otherid != INVALID_PLAYER_ID && otherid != playerid)
{
new Float:posx, Float:posy, Float:posz;
GetPlayerPos(otherid,posx,posy,posz);
SetPlayerInterior(playerid,GetPlayerInterior(otherid));
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(otherid));
if (GetPlayerState(playerid) == 2)
{
new car = GetPlayerVehicleID(playerid);
SetVehiclePos(car, posx, posy+4, posz);
}
else { SetPlayerPos(playerid,posx,posy+2, posz); } } // When i delete one of this brackets I get much errors.. You known: The bracket-error :(
else
{ SendClientMessage(playerid, COLOR_RED, "Fehler: Spieler nicht gefunden oder eigene ID!"); }
else // Here ist the error!
{ SendClientMessage(playerid, COLOR_RED, "Du bist kein Administrator!"); }
}
return 1;
}
The error:
Код:
***********************(289) : error 029: invalid expression, assumed zero
Re: Fail by error.. -
WillyP - 24.08.2010
pawn Код:
{ SendClientMessage(playerid, COLOR_RED, "Du bist kein Administrator!"); }
return 1;
}
Re: Fail by error.. -
XCarBOn - 24.08.2010
I get 20 errors when i change the bracket.. it's this bracket fail. Help?
Re: Fail by error.. -
Mr. Despair - 24.08.2010
What line is the 289?
Re: Fail by error.. -
Jeffry - 25.08.2010
pawn Код:
if (strcmp(cmd, "/goto", true) == 0)
{
new tmp[30];
tmp = strtok(cmdtext, idx);
new otherid;
otherid = strval(tmp);
if(UserStats[playerid][Admin] >= 2)
{
if(IsPlayerConnected(otherid) && otherid != INVALID_PLAYER_ID && otherid != playerid)
{
new Float:posx, Float:posy, Float:posz;
GetPlayerPos(otherid,posx,posy,posz);
SetPlayerInterior(playerid,GetPlayerInterior(otherid));
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(otherid));
if (GetPlayerState(playerid) == 2)
{
new car = GetPlayerVehicleID(playerid);
SetVehiclePos(car, posx, posy+4, posz);
}
else
{
SetPlayerPos(playerid,posx,posy+2, posz);
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Fehler: Spieler nicht gefunden oder eigene ID!");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Du bist kein Administrator!");
}
return 1;
}
I fixed the indentation & the error. Should work now.
Try it out.
Greetz.
AW: Fail by error.. -
XCarBOn - 26.08.2010
Thanks works!
Re: AW: Fail by error.. -
Jeffry - 27.08.2010
Quote:
Originally Posted by XCarBOn
Thanks works!
|
Nice, and Thanks for the feedback.
Many people are not giving a feedback, and I think thats not fair.
I am always happy about a feedback.
Have fun.