SA-MP Forums Archive
i cant fix my enter and exit command.. - 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: i cant fix my enter and exit command.. (/showthread.php?tid=573222)



i cant fix my enter and exit command.. - IndependentGaming - 05.05.2015

this is my command,

PHP код:
CMD:exit(playerid,params[])
{
    for(new 
0sizeof(DoorInfo); i++) {
        if(
IsPlayerInRangeOfPoint(playerid,3.0,DoorInfo[i][dExitX],DoorInfo[i][dExitY],DoorInfo[i][dExitZ])) {
            
SetPlayerPos(playeridDoorInfo[i][dEnterX],DoorInfo[i][dEnterY],DoorInfo[i][dEnterZ]); SetPlayerInterior(playeridDoorInfo[i][dEnterInt]); SetPlayerVirtualWorld(playeridDoorInfo[i][dEnterVW]); }
    {
            if(
DoorInfo[i][ddCustomInterior]) Player_StreamPrep(playeridDoorInfo[i][dEnterX],DoorInfo[i][dEnterY],DoorInfo[i][dEnterZ], FREEZE_TIME);
    }
    return 
1;
}
CMD:enter(playerid,params[])
{
    for(new 
0sizeof(DoorInfo); i++) {
        if(
IsPlayerInRangeOfPoint(playerid,3.0,DoorInfo[i][dEnterX],DoorInfo[i][dEnterY],DoorInfo[i][dEnterZ])) {
            
SetPlayerPos(playeridDoorInfo[i][dExitX],DoorInfo[i][dExitY],DoorInfo[i][dExitZ]); SetPlayerInterior(playeridDoorInfo[i][dExitInt]); SetPlayerVirtualWorld(playeridDoorInfo[i][dExitVW]); }
    {
            if(
DoorInfo[i][ddCustomExterior]) Player_StreamPrep(playeridDoorInfo[i][dEnterX],DoorInfo[i][dEnterY],DoorInfo[i][dEnterZ], FREEZE_TIME);
    }
    return 
1;

Getting this errors:

PHP код:
(381) : warning 217loose indentation
(387) : warning 217loose indentation
(387) : error 029invalid expressionassumed zero
C
:\Users\Kevin\Desktop\Deathmatch Neo\filterscripts\DoorSys.pwn(387) : error 017undefined symbol "cmd_enter"
(387) : error 029invalid expressionassumed zero
(387) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors

i think there is something wrong in the commands!


Re: i cant fix my enter and exit command.. - Konstantinos - 05.05.2015

Extra opened bracket. Indenting your code properly so it'll be readable would be easier way to figure it out.

PHP код:
CMD:exit(playerid,params[])
{
    for(new 
0sizeof(DoorInfo); i++)
    {
        if(
IsPlayerInRangeOfPoint(playerid,3.0,DoorInfo[i][dExitX],DoorInfo[i][dExitY],DoorInfo[i][dExitZ]))
        {
            
SetPlayerPos(playeridDoorInfo[i][dEnterX],DoorInfo[i][dEnterY],DoorInfo[i][dEnterZ]);
            
SetPlayerInterior(playeridDoorInfo[i][dEnterInt]); SetPlayerVirtualWorld(playeridDoorInfo[i][dEnterVW]);
        }
        if(
DoorInfo[i][ddCustomInterior])
        {
            
Player_StreamPrep(playeridDoorInfo[i][dEnterX],DoorInfo[i][dEnterY],DoorInfo[i][dEnterZ], FREEZE_TIME);
        }
    }
    return 
1;