SA-MP Forums Archive
Script Help! - 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: Script Help! (/showthread.php?tid=348166)



Script Help! - irajninger - 04.06.2012

Hello
I have a problem..

Код:
}
}
    if(strcmp(cmdtext, "/tower", true) == 0)
    {
        SetPlayerCameraPos(playerid, 2618.3955, 956.4876, 749.8432);
        SendClientMessage(playerid, 0x21DD00FF, "You have teleported to TOWER!!!.");
        return 1;
        }
	return 0;
}
and it give's me this
Код:
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\mygamemode.pwn(1627) : warning 217: loose indentation
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\mygamemode.pwn(1633) : warning 217: loose indentation
When i fix it and type /tower ingame it won't work!
so please can you tell me what's the problem?


Re: Script Help! - Youice - 04.06.2012

show us the warnings lines, simply its like (your code not organized)


Re: Script Help! - mati233 - 04.06.2012

Did you at least tried to search for that error?


Re: Script Help! - doreto - 04.06.2012

Quote:
Originally Posted by mati233
Посмотреть сообщение
WRONG

pawn Код:
if(strcmp(cmdtext, "/tower", true) == 0)
    {
        SetPlayerCameraPos(playerid, 2618.3955, 956.4876, 749.8432);
        SendClientMessage(playerid, 0x21DD00FF, "You have teleported to TOWER!!!.");
        return 1;
        }
    return 0;
}

CORRECT


pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/tower", cmdtext, true, 10) == 0)
    {
        SetPlayerCameraPos(playerid, 2618.3955, 956.4876, 749.8432);
        SendClientMessage(playerid, 0x21DD00FF, "You have teleported to TOWER!!!.");
        return 1;
    }
    return 0;
}



Re: Script Help! - Sandiel - 04.06.2012

You missed your...BRACKETS!


Re: Script Help! - irajninger - 04.06.2012

Quote:

show us the warnings lines, simply its like (your code not organized)

C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\mygamemode.pwn(1627) : warning 217: loose indentation = SetPlayerCameraPos(playerid, 2618.3955, 956.4876, 749.8432);
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\mygamemode.pwn(1633) : warning 217: loose indentation = return 0;


Re: Script Help! - doreto - 04.06.2012

Quote:
Originally Posted by irajninger
Посмотреть сообщение
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\mygamemode.pwn(1627) : warning 217: loose indentation = SetPlayerCameraPos(playerid, 2618.3955, 956.4876, 749.8432);
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\mygamemode.pwn(1633) : warning 217: loose indentation = return 0;
did you just ignore my post ? i show you your wrong code and how it shout be


Re: Script Help! - irajninger - 04.06.2012

Thank you all for your help!!




EDITorry i didn't ignore your post i only made this earlier post sorry!


Re: Script Help! - Flake. - 04.06.2012

Put

pawn Код:
#pragma tabsize 0
at the top your your script