what's wrong? [Undefined symbole "playerid"?]
#1

Hi , i have Map change system , so whene i complie my script it says :
Код:
C:\DOCUME~1\PC\Bureau\cs\GAMEMO~1\WAR.pwn(113) : warning 202: number of arguments does not match definition
C:\DOCUME~1\PC\Bureau\cs\GAMEMO~1\WAR.pwn(528) : error 017: undefined symbol "playerid"
C:\DOCUME~1\PC\Bureau\cs\GAMEMO~1\WAR.pwn(529) : error 017: undefined symbol "playerid"
C:\DOCUME~1\PC\Bureau\cs\GAMEMO~1\WAR.pwn(530) : error 017: undefined symbol "playerid"
C:\DOCUME~1\PC\Bureau\cs\GAMEMO~1\WAR.pwn(531) : error 017: undefined symbol "playerid"
C:\DOCUME~1\PC\Bureau\cs\GAMEMO~1\WAR.pwn(532) : error 017: undefined symbol "playerid"
C:\DOCUME~1\PC\Bureau\cs\GAMEMO~1\WAR.pwn(533) : error 017: undefined symbol "playerid"
C:\DOCUME~1\PC\Bureau\cs\GAMEMO~1\WAR.pwn(537) : error 017: undefined symbol "playerid"
C:\DOCUME~1\PC\Bureau\cs\GAMEMO~1\WAR.pwn(538) : error 017: undefined symbol "playerid"
C:\DOCUME~1\PC\Bureau\cs\GAMEMO~1\WAR.pwn(539) : error 017: undefined symbol "playerid"
C:\DOCUME~1\PC\Bureau\cs\GAMEMO~1\WAR.pwn(540) : error 017: undefined symbol "playerid"
C:\DOCUME~1\PC\Bureau\cs\GAMEMO~1\WAR.pwn(541) : error 017: undefined symbol "playerid"
C:\DOCUME~1\PC\Bureau\cs\GAMEMO~1\WAR.pwn(542) : error 017: undefined symbol "playerid"
C:\DOCUME~1\PC\Bureau\cs\GAMEMO~1\WAR.pwn(1099) : warning 217: loose indentation
C:\DOCUME~1\PC\Bureau\cs\GAMEMO~1\WAR.pwn(1566) : warning 203: symbol is never used: "params"
C:\DOCUME~1\PC\Bureau\cs\GAMEMO~1\WAR.pwn(1566 -- 1581) : warning 203: symbol is never used: "PlayerKills"
C:\DOCUME~1\PC\Bureau\cs\GAMEMO~1\WAR.pwn(1566 -- 1581) : warning 203: symbol is never used: "Zabil"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


12 Errors.
the errors line :
pawn Код:
forward NextMap();
public NextMap() {
    if(Cmaps > 1) Cmaps = 0;
    switch(Cmaps) {
        case 0: {
            if(gTeam[playerid] == TEAM_CT) {
                SetPlayerPos(playerid,2533.8667,2753.3320,10.8203);
                SetPlayerFacingAngle(playerid,90.5278);
            } else if(gTeam[playerid] == TEAM_T) {
                SetPlayerPos(playerid,2667.8340,2717.2986,10.8203);
                SetPlayerFacingAngle(playerid,31.6018);
            }
            CurrentMap = 0;
        } case 1: {
            if(gTeam[playerid] == TEAM_CT) {
                SetPlayerPos(playerid,1801.1047,-2991.1992,6.1988);
                SetPlayerFacingAngle(playerid,183.9618);
            } else if(gTeam[playerid] == TEAM_T) {
                SetPlayerPos(playerid,1846.0448,-3083.0525,6.6550);
                SetPlayerFacingAngle(playerid,44.1783);
            }
            CurrentMap = 1;
        }
    }
    Cmaps++;
}
i hope you help me to fix those errors
Reply
#2

Try this:
pawn Код:
forward NextMap( );
public NextMap( )
{
    for( new slots = GetMaxPlayers( ), i; i < slots; i++ )
    {
        if ( !IsPlayerConnected( i ) ) continue;

        if( Cmaps > 1 ) Cmaps = 0;
        switch( Cmaps )
        {
            case 0:
            {
                if( gTeam[ i ] == TEAM_CT )
                {
                    SetPlayerPos( i, 2533.8667, 2753.3320, 10.8203 );
                    SetPlayerFacingAngle( i, 90.5278 );
                }
                else if( gTeam[ i ] == TEAM_T )
                {
                    SetPlayerPos( i, 2667.8340, 2717.2986, 10.8203 );
                    SetPlayerFacingAngle( i, 31.6018 );
                }
                CurrentMap = 0;
            }
            case 1:
            {
                if( gTeam[ i ] == TEAM_CT )
                {
                    SetPlayerPos( i, 1801.1047, -2991.1992, 6.1988 );
                    SetPlayerFacingAngle( i, 183.9618 );
                }
                else if( gTeam[ i ] == TEAM_T )
                {
                    SetPlayerPos( i, 1846.0448, -3083.0525, 6.6550 );
                    SetPlayerFacingAngle( i, 44.1783 );
                }
                CurrentMap = 1;
            }
        }
        Cmaps ++;
    }
}
Reply
#3

Thank you man the i don't get the errors but now whene i run samp-server it crash :
crash info :
Код:
SA-MP Server: 0.3d-R2



Exception At Address: 0x0047B2F2



Registers:

EAX: 0x01CEAE48	EBX: 0x0012F960	ECX: 0x00000001	EDX: 0x01001000

ESI: 0x00D36BFC	EDI: 0x00CBDA78	EBP: 0x0012FD84	ESP: 0x0012F940

EFLAGS: 0x00010206



Stack:

+0000: 0x00CBDA78   0x01001000   0x702E7325   0x00747261

+0010: 0x00D36BD4   0x0012FDA0   0x00000008   0x00000000

+0020: 0x0012FC00   0x7C920970   0x7C98E4C0   0x7C9240EF

+0030: 0x7C9240BB   0x00000000   0x7FFDFC00   0xFFFFFFFF

+0040: 0x00000002   0x0000003C   0x00020024   0x7FFDF000

+0050: 0x00000000   0x000A0008   0x7C923E88   0x0000021A

+0060: 0x00000000   0x00000000   0x0012FC48   0x7C920970

+0070: 0x00000070   0x00000000   0x0072004E   0x0012F9D8

+0080: 0x00240022   0x7FFDFC00   0x0012F9D8   0x00000005

+0090: 0x001420A0   0x01000000   0x003A0043   0x0044005C

+00A0: 0x0063006F   0x006D0075   0x006E0065   0x00730074

+00B0: 0x00610020   0x0064006E   0x00530020   0x00740065

+00C0: 0x00690074   0x0067006E   0x005C0073   0x00430050

+00D0: 0x0012FA44   0x003A0000   0x7C920732   0x00000004

+00E0: 0x003A0748   0x003A0000   0x00000000   0x0012FA1C

+00F0: 0x0064006F   0x0012FC60   0x7C91EE18   0x000001D4

+0100: 0x0012FC70   0x7C921538   0x7C921596   0x7C9206EB

+0110: 0x003A6E00   0x00000018   0x00D36BD4   0x00000000

+0120: 0x00000000   0x00000000   0x00000000   0x00000000

+0130: 0x7C91D4EA   0x7C9280FF   0xFFFFFFFF   0x0012FAB0
what is that ?
Reply
#4

Quote:
Originally Posted by ServerScripter
Посмотреть сообщение
Thank you man the i don't get the errors but now whene i run samp-server it crash :
crash info :
Код:
SA-MP Server: 0.3d-R2



Exception At Address: 0x0047B2F2



Registers:

EAX: 0x01CEAE48	EBX: 0x0012F960	ECX: 0x00000001	EDX: 0x01001000

ESI: 0x00D36BFC	EDI: 0x00CBDA78	EBP: 0x0012FD84	ESP: 0x0012F940

EFLAGS: 0x00010206



Stack:

+0000: 0x00CBDA78   0x01001000   0x702E7325   0x00747261

+0010: 0x00D36BD4   0x0012FDA0   0x00000008   0x00000000

+0020: 0x0012FC00   0x7C920970   0x7C98E4C0   0x7C9240EF

+0030: 0x7C9240BB   0x00000000   0x7FFDFC00   0xFFFFFFFF

+0040: 0x00000002   0x0000003C   0x00020024   0x7FFDF000

+0050: 0x00000000   0x000A0008   0x7C923E88   0x0000021A

+0060: 0x00000000   0x00000000   0x0012FC48   0x7C920970

+0070: 0x00000070   0x00000000   0x0072004E   0x0012F9D8

+0080: 0x00240022   0x7FFDFC00   0x0012F9D8   0x00000005

+0090: 0x001420A0   0x01000000   0x003A0043   0x0044005C

+00A0: 0x0063006F   0x006D0075   0x006E0065   0x00730074

+00B0: 0x00610020   0x0064006E   0x00530020   0x00740065

+00C0: 0x00690074   0x0067006E   0x005C0073   0x00430050

+00D0: 0x0012FA44   0x003A0000   0x7C920732   0x00000004

+00E0: 0x003A0748   0x003A0000   0x00000000   0x0012FA1C

+00F0: 0x0064006F   0x0012FC60   0x7C91EE18   0x000001D4

+0100: 0x0012FC70   0x7C921538   0x7C921596   0x7C9206EB

+0110: 0x003A6E00   0x00000018   0x00D36BD4   0x00000000

+0120: 0x00000000   0x00000000   0x00000000   0x00000000

+0130: 0x7C91D4EA   0x7C9280FF   0xFFFFFFFF   0x0012FAB0
what is that ?
I don't know, use Crashdetect plugin or talk to kalcor...
Reply
#5

Server log, post it.
Reply
#6

Quote:
Originally Posted by aRoach
Посмотреть сообщение
Try this:
pawn Код:
forward NextMap( );
public NextMap( )
{
    for( new slots = GetMaxPlayers( ), i; i < slots; i++ )
    {
        if ( !IsPlayerConnected( i ) ) continue;

        if( Cmaps > 1 ) Cmaps = 0;
        switch( Cmaps )
        {
            case 0:
            {
                if( gTeam[ i ] == TEAM_CT )
                {
                    SetPlayerPos( i, 2533.8667, 2753.3320, 10.8203 );
                    SetPlayerFacingAngle( i, 90.5278 );
                }
                else if( gTeam[ i ] == TEAM_T )
                {
                    SetPlayerPos( i, 2667.8340, 2717.2986, 10.8203 );
                    SetPlayerFacingAngle( i, 31.6018 );
                }
                CurrentMap = 0;
            }
            case 1:
            {
                if( gTeam[ i ] == TEAM_CT )
                {
                    SetPlayerPos( i, 1801.1047, -2991.1992, 6.1988 );
                    SetPlayerFacingAngle( i, 183.9618 );
                }
                else if( gTeam[ i ] == TEAM_T )
                {
                    SetPlayerPos( i, 1846.0448, -3083.0525, 6.6550 );
                    SetPlayerFacingAngle( i, 44.1783 );
                }
                CurrentMap = 1;
            }
        }
        Cmaps ++;
    }
}
WTF?!
Why on earth are you doing that?!
You do not need to do stuff like that, for these types of cases!
pawn Код:
for(new i; i < GetMaxPlayers(); i++)
Reply
#7

Server logs :
pawn Код:
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, (C)2005-2011 SA-MP Team

[12:14:10]
[12:14:10] Server Plugins
[12:14:10] --------------
[12:14:10]  Loading plugin: streamer
[12:14:10]

*** Streamer Plugin v2.5.2 R2 by Incognito loaded ***

[12:14:10]   Loaded.
[12:14:10]  Loaded 1 plugins.

[12:14:10]
[12:14:10] Ban list
[12:14:10] --------
[12:14:10]  Loaded: samp.ban
[12:14:10]
[12:14:10]
[12:14:10] Filterscripts
[12:14:10] ---------------
[12:14:10]   Loading filterscript 'ALAE.amx'...
[12:14:10]
--------------------------------------
[12:14:10]  Text Draw Editor 1.0RC2 by Zamaroht for SA-MP 0.3 Loaded.
[12:14:10] --------------------------------------

[12:14:10]   Loaded 1 filterscripts.
@Fire Cat ok i will check it
Reply
#8

At least for some of the errors:
pawn Код:
forward NextMap(playerid);
public NextMap(playerid)
Atm this will solve ALL the playerid errors.
Reply
#9

Quote:
Originally Posted by ricardo178
Посмотреть сообщение
At least for some of the errors:
pawn Код:
forward NextMap(playerid);
public NextMap(playerid)
Atm this will solve ALL the playerid errors.
But you still need to change the timer to SetTimerEx and pass the playerid to the callback.
Reply
#10

Quote:
Originally Posted by FireCat
Посмотреть сообщение
WTF?!
Why on earth are you doing that?!
You do not need to do stuff like that, for these types of cases!
pawn Код:
for(new i; i < GetMaxPlayers(); i++)
For your information, doing
pawn Код:
for( new slots = GetMaxPlayers( ), i; i < slots; i++ )
is actually FASTER than doing
pawn Код:
for(new i; i < GetMaxPlayers(); i++)
Similarly, doing
pawn Код:
for(new i, j = strlen(string); i < j; i++)
is also FASTER than doing
pawn Код:
for(new i; i < strlen(string); i++)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)