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



Need Help! Small Problem. - TwisTa98 - 16.09.2012

Hello All! I Have A Small Problem. When I Write This:

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
		if (strcmp("/LSPD", cmdtext, true, 10) == 0)
		{
			SendClientMessage(playerid, COLOR_YELLOW, "Shen Shexvedi LSPD-Shi!");
			pTeam[playerid] = team_lspd;
			return 1;
		}
		if (strcmp("/myteam", cmdtext, true, 10) == 0)
		{
			if(pTeam[playerid] == team_lspd) {
			SendClientMessage(playerid, COLOR_YELLOW, "Shen Xar LSPD's Officeri!");
			return 1;
		if(pTeam[playerid] == team_grove{
		SendClientMessage(playerid, COLOR_YELLOW, "Shen Ukve Xar Grove's Wevri!");
		return 1;
		}
	return 1;
}
After Saving is Warning This:
Код:
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(532) : warning 225: unreachable code
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(532) : error 029: invalid expression, assumed zero
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(540) : error 029: invalid expression, assumed zero
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(540) : error 004: function "OnPlayerEnterVehicle" is not implemented
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(545) : warning 225: unreachable code
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(545) : error 029: invalid expression, assumed zero
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(545) : error 004: function "OnPlayerExitVehicle" is not implemented
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(550) : warning 225: unreachable code
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(550) : error 029: invalid expression, assumed zero
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(550) : error 004: function "OnPlayerStateChange" is not implemented
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(555) : warning 225: unreachable code
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(555) : error 029: invalid expression, assumed zero
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(555) : error 004: function "OnPlayerEnterCheckpoint" is not implemented
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(560) : warning 225: unreachable code
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(560) : error 029: invalid expression, assumed zero
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(560) : error 004: function "OnPlayerLeaveCheckpoint" is not implemented
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(565) : warning 225: unreachable code
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(565) : error 029: invalid expression, assumed zero
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(565) : error 004: function "OnPlayerEnterRaceCheckpoint" is not implemented
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(570) : warning 225: unreachable code
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(570) : error 029: invalid expression, assumed zero
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(570) : error 004: function "OnPlayerLeaveRaceCheckpoint" is not implemented
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(575) : warning 225: unreachable code
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(575) : error 029: invalid expression, assumed zero
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(575) : error 004: function "OnRconCommand" is not implemented
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(580) : warning 225: unreachable code
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(580) : error 029: invalid expression, assumed zero
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(580) : error 004: function "OnPlayerRequestSpawn" is not implemented
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(585) : warning 225: unreachable code
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(585) : error 029: invalid expression, assumed zero
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(585) : error 004: function "OnObjectMoved" is not implemented
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(590) : warning 225: unreachable code
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(590) : error 029: invalid expression, assumed zero
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(590) : error 004: function "OnPlayerObjectMoved" is not implemented
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(595) : warning 225: unreachable code
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(595) : error 029: invalid expression, assumed zero
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(595) : error 004: function "OnPlayerPickUpPickup" is not implemented
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(600) : warning 225: unreachable code
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(600) : error 029: invalid expression, assumed zero

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
Please TellMe Where Have I Warning..?


FIXED!


Re: Need Help! Small Problem. - Deal-or-die - 16.09.2012

Missing a bracket.
try this
pawn Код:
Edited out.
EDIT

try this
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/LSPD", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, COLOR_YELLOW, "Shen Shexvedi LSPD-Shi!");
        pTeam[playerid] = team_lspd;
        return 1;
    }
    if (strcmp("/myteam", cmdtext, true, 10) == 0)
    {
        if(pTeam[playerid] == team_lspd)
        {
            SendClientMessage(playerid, COLOR_YELLOW, "Shen Xar LSPD's Officeri!");
            return 1;
        }
        if(pTeam[playerid] == team_grove
        {
            SendClientMessage(playerid, COLOR_YELLOW, "Shen Ukve Xar Grove's Wevri!");
            return 1;
        }
    }
    return 1;
}



Re: Need Help! Small Problem. - TwisTa98 - 16.09.2012

Quote:
Originally Posted by Deal-or-die
Посмотреть сообщение
Missing a bracket.
try this
pawn Код:
Clear
EDIT

try this
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
        if (strcmp("/LSPD", cmdtext, true, 10) == 0)
        {
            SendClientMessage(playerid, COLOR_YELLOW, "Shen Shexvedi LSPD-Shi!");
            pTeam[playerid] = team_lspd;
            return 1;
        }
        if (strcmp("/myteam", cmdtext, true, 10) == 0)
        {
            if(pTeam[playerid] == team_lspd)
            {
                SendClientMessage(playerid, COLOR_YELLOW, "Shen Xar LSPD's Officeri!");
                return 1;
            }
            if(pTeam[playerid] == team_grove
            {
                SendClientMessage(playerid, COLOR_YELLOW, "Shen Ukve Xar Grove's Wevri!");
                return 1;
            }
        }
    return 1;
}
Thank You But Now Is This 1 Error:

Код:
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(535) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: Need Help! Small Problem. - Deal-or-die - 16.09.2012

Ahh, I just updated my previous code to tidy up the indentation so grab thats again.

Also, Which line is 535?


(Also another suggestion is to use a different command processor such as zcmd or y_cmd)


Re: Need Help! Small Problem. - JaKe Elite - 16.09.2012

Replace this

pawn Код:
if(pTeam[playerid] == team_grove
to this

pawn Код:
if(pTeam[playerid] == team_grove)



Re: Need Help! Small Problem. - Deal-or-die - 16.09.2012

Nice spotting, didn't see that.


Re: Need Help! Small Problem. - TwisTa98 - 16.09.2012

Thanks Now Is Only This Errors:

Quote:

C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(552) : warning 209: function "OnPlayerCommandText" should return a value
C:\Documents and Settings\TwisTa\Рабочий стол\BIG CITY LIFE OFFICIAL AMX\gamemodes\BCL.pwn(553) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

I'm Lamer :XXX :@


Re: Need Help! Small Problem. - TwisTa98 - 16.09.2012

Not not! I fixed This!