help with bracket - 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: help with bracket (
/showthread.php?tid=273425)
help with bracket -
jaksimaksi - 01.08.2011
What the hell is wrong with brackets. When i type /enter ive get SERVER UNKNOWN COMMAND...
pawn Code:
CMD:enter(playerid, params[]) {
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "veik");
for(new i = 0; i < sizeof(Houses); i++)
{
if (PlayerToPoint(1.0, playerid,Houses[i][EnterX], Houses[i][EnterY], Houses[i][EnterZ]))
{
if(GetPlayerVirtualWorld(playerid) == Houses[i][EnterWorld])
{
if(PlayerInfo[playerid][pHouseKey] == i || Houses[i][Locked] == 0 || PlayerInfo[playerid][pAdmin] >= 1)
{
SetPlayerInterior(playerid,Houses[i][ExitInterior]);
SetPlayerPos(playerid,Houses[i][ExitX],Houses[i][ExitY],Houses[i][ExitZ]);
SetPlayerVirtualWorld(playerid,i);
SetPlayerFacingAngle(playerid,Houses[i][ExitAngle]);
return 1;
}
}
}
}
}
Re: help with bracket -
sleepysnowflake - 01.08.2011
pawn Code:
CMD:enter(playerid, params[])
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "veik");
for(new i = 0; i < sizeof(Houses); i++)
{
if (PlayerToPoint(1.0, playerid,Houses[i][EnterX], Houses[i][EnterY], Houses[i][EnterZ]))
{
if(GetPlayerVirtualWorld(playerid) == Houses[i][EnterWorld])
{
if(PlayerInfo[playerid][pHouseKey] == i || Houses[i][Locked] == 0 || PlayerInfo[playerid][pAdmin] >= 1)
{
SetPlayerInterior(playerid,Houses[i][ExitInterior]);
SetPlayerPos(playerid,Houses[i][ExitX],Houses[i][ExitY],Houses[i][ExitZ]);
SetPlayerVirtualWorld(playerid,i);
SetPlayerFacingAngle(playerid,Houses[i][ExitAngle]);
}
}
}
}
return 1;
}
Re: help with bracket -
Jafet_Macario - 01.08.2011
Deleted
AW: help with bracket -
jaksimaksi - 01.08.2011
Berlovan - Still Server unknown command
Jafet_M, lots of errors
AW: help with bracket -
jaksimaksi - 01.08.2011
Ow.. My all commands is not working ... what the hell?
In server log:
Re: help with bracket -
sleepysnowflake - 01.08.2011
No ideea
Do you have something there on OnPlayerCommandsText ?
AW: help with bracket -
jaksimaksi - 01.08.2011
im such an idiot, I was doing it on other gamemode OMG
Re: help with bracket -
Kush - 01.08.2011
Are you sure you have the main function included into your script?
AW: help with bracket -
jaksimaksi - 01.08.2011
pawn Code:
CMD:enter(playerid, params[])
{
for(new i = 0; i < sizeof(Houses); i++)
{
if (PlayerToPoint(1.0, playerid,Houses[i][EnterX], Houses[i][EnterY], Houses[i][EnterZ]))
{
if(GetPlayerVirtualWorld(playerid) == Houses[i][EnterWorld])
{
if(PlayerInfo[playerid][pHouseKey] == i || Houses[i][Locked] == 0 || PlayerInfo[playerid][pAdmin] >= 1)
{
SetPlayerInterior(playerid,Houses[i][ExitInterior]);
SetPlayerPos(playerid,Houses[i][ExitX],Houses[i][ExitY],Houses[i][ExitZ]);
SetPlayerVirtualWorld(playerid,i);
SetPlayerFacingAngle(playerid,Houses[i][ExitAngle]);
GameTextForPlayer(playerid, "working", 5000, 1);
}
}
}
}
return 1;
}
Okay now everything seems to be fine, but when I write /enter nothing happens
Re: help with bracket -
=WoR=Varth - 02.08.2011
You can check where the code stop by debug
pawn Code:
CMD:enter(playerid, params[])
{
print("1");
for(new i = 0; i < sizeof(Houses); i++)
{
print("2");
if (PlayerToPoint(1.0, playerid,Houses[i][EnterX], Houses[i][EnterY], Houses[i][EnterZ]))
{
print("3");
if(GetPlayerVirtualWorld(playerid) == Houses[i][EnterWorld])
{
print("4");
if(PlayerInfo[playerid][pHouseKey] == i || Houses[i][Locked] == 0 || PlayerInfo[playerid][pAdmin] >= 1)
{
print("5");
SetPlayerInterior(playerid,Houses[i][ExitInterior]);
SetPlayerPos(playerid,Houses[i][ExitX],Houses[i][ExitY],Houses[i][ExitZ]);
SetPlayerVirtualWorld(playerid,i);
SetPlayerFacingAngle(playerid,Houses[i][ExitAngle]);
GameTextForPlayer(playerid, "working", 5000, 1);
}
}
}
}
return 1;
}