Need help! To add player classes and more.
#21

Instead torturing yourself with AddPlayerClass use this:

pawn Код:
public OnGameModeInit()
{
    for (new i = 0; i < 300; i++)
{
    if (IsValidSkin(i))
    {
        AddPlayerClass(i, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); //Adds all the classes
    }
}
Outside any callbacks:

pawn Код:
IsValidSkin(skinid)
{
    switch (skinid)
    {
        case 0, 3, 4, 5, 6, 8, 42, 65, 74, 86, 119, 149, 208, 265, 266, 267, 273, 289: { return 0; } //The classes that you dont want to have in your GM
        default: {return 1;}
    }
    return 1;
}
Reply
#22

Owh thank you! with that i just got these "small" errors..

Код:
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(47) : error 017: undefined symbol "IsValidSkin"
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(54) : warning 217: loose indentation
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(54) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(54) : error 004: function "OnGameModeExit" is not implemented
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(59) : warning 225: unreachable code
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(59) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(59) : error 004: function "OnPlayerRequestClass" is not implemented
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(61) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(62) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(63) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(64) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(65) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(69) : warning 225: unreachable code
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(69) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(69) : error 004: function "OnPlayerConnect" is not implemented
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(71) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(72) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(76) : warning 225: unreachable code
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(76) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(76) : error 004: function "OnPlayerDisconnect" is not implemented
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(81) : warning 225: unreachable code
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(81) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(81) : error 004: function "OnPlayerSpawn" is not implemented
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(83) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(87) : warning 225: unreachable code
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(87) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(87) : error 004: function "OnPlayerDeath" is not implemented
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(92) : warning 225: unreachable code
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(92) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(92) : error 004: function "OnVehicleSpawn" is not implemented
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(97) : warning 225: unreachable code
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(97) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(97) : error 004: function "OnVehicleDeath" is not implemented
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(102) : warning 225: unreachable code
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(102) : error 029: invalid expression, assumed zero

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


26 Errors.
Reply
#23

pawn Код:
public OnGameModeInit()
{
  for (new i = 0; i < 300; i++)
  {
    if (IsValidSkin(i))
    {
        AddPlayerClass(i, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); //Adds all the classes
    }
  }
  return 1;
}
Just a bracket missing
Reply
#24

do it like this:
pawn Код:
public OnGameModeInit()
{
    //classes
    for (new i = 0; i < 300; i++)
    {
        if (IsValidSkin(i))
        {
            AddPlayerClass(i, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); //Adds all classes.
        }
    }
    return 1;
}

IsValidSkin(skinid)
{
    switch (skinid)
    {
        case 0, 3, 4, 5, 6, 8, 42, 65, 74, 86, 119, 149, 208, 265, 266, 267, 273, 289: { return 0; } //Unavailible classes and classes you dont want.
        default: {return 1;}
    }
    return 1;
}
Reply
#25

Ty works flawless! how to edit the start point? i still start at that stairs in vegas..
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)