SA-MP Forums Archive
Crazy bug - 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: Crazy bug (/showthread.php?tid=624194)



Crazy bug - SukMathcuck - 12.12.2016

I did not understand the problem?

PHP Code:

****if(slot*==*1//error 029
    
{
        for(new 
0MAX_PLAYERSi++) idonline GetPlayerID(Account[i][pPersonagem1], 0);
    }
    if(
slot*==*2)
    {
        for(new 
0MAX_PLAYERSi++) idonline GetPlayerID(Account[i][pPersonagem2], 0);
    }
    if(
slot*==*3)
    {
        for(new 
0MAX_PLAYERSi++) idonline GetPlayerID(Account[i][pPersonagem3], 0);
    }

Code:
C:\Users\User\Desktop\San Andreas Multiplayer\gamemode RP\gamemodes\gamemode2.pwn(510) : warning 217: loose indentation
C:\Users\User\Desktop\San Andreas Multiplayer\gamemode RP\gamemodes\gamemode2.pwn(510) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\San Andreas Multiplayer\gamemode RP\gamemodes\gamemode2.pwn(510) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\San Andreas Multiplayer\gamemode RP\gamemodes\gamemode2.pwn(510) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\San Andreas Multiplayer\gamemode RP\gamemodes\gamemode2.pwn(510) : fatal error 107: too many error messages on one line

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


Re: Crazy bug - AbyssMorgan - 12.12.2016

https://sampwiki.blast.hk/wiki/Control_Structures#if


Re: Crazy bug - Luis- - 12.12.2016

I don't understand where you've gotten the idea of using "*" in if statements.


Re: Crazy bug - SukMathcuck - 12.12.2016

Was solved! Found an error, it did right, as the wiki said, but it does not work because?

PHP Code:
    if(slot == 1)
    {
        for(new 
0MAX_PLAYERSi++) idonline GetPlayerID(Account[i][pPersonagem1]);
    }
    if(
slot == 2)
    {
        for(new 
0MAX_PLAYERSi++) idonline GetPlayerID(Account[i][pPersonagem2]);
    }
    if(
slot == 3)
    {
        for(new 
0MAX_PLAYERSi++) idonline GetPlayerID(Account[i][pPersonagem3]);
    } 
Code:
C:\Users\User\Desktop\San Andreas Multiplayer\gamemode RP\gamemodes\gamemode2.pwn(512) : error 017: undefined symbol "GetPlayerID"
C:\Users\User\Desktop\San Andreas Multiplayer\gamemode RP\gamemodes\gamemode2.pwn(516) : error 017: undefined symbol "GetPlayerID"
C:\Users\User\Desktop\San Andreas Multiplayer\gamemode RP\gamemodes\gamemode2.pwn(520) : error 017: undefined symbol "GetPlayerID"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.



Re: Crazy bug - Hansrutger - 12.12.2016

Because you need to implement "GetPlayerID" function.

Code:
GetPlayerID(const playername[])
{
	foreach (new i : Player)
	{
	    if (IsPlayerConnected(i) && !strcmp(ReturnName(i), playername))
	    {
	        return i;
	    }
	}
	return INVALID_PLAYER_ID;
}



Re: Crazy bug - SukMathcuck - 12.12.2016

Quote:
Originally Posted by Hansrutger
View Post
Because you need to implement "GetPlayerID" function.

Code:
GetPlayerID(const playername[])
{
	foreach (new i : Player)
	{
	    if (IsPlayerConnected(i) && !strcmp(ReturnName(i), playername))
	    {
	        return i;
	    }
	}
	return INVALID_PLAYER_ID;
}
PHP Code:
C:\Users\User\Desktop\San Andreas Multiplayer\gamemode RP\gamemodes\gamemode2.pwn(250) : error 017undefined symbol "ReturnName"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
1 Error




Re: Crazy bug - Hansrutger - 12.12.2016

lmao my bad xD

Use:
GetPlayerName()
https://sampwiki.blast.hk/wiki/GetPlayerName

Figure out how to turn the function I gave you into using GetPlayerName to fully learn how to fix your own "undefined symbol" errors. :P