• 05 Avril 2025, 22:41:48


Auteur Sujet: [ERREUR] error 017: undefined symbol "SetPlayerTeamFromClass"  (Lu 1924 fois)

0 Membres et 1 Invité sur ce sujet

Hors ligne D4rK Fre4K

  • *
  • Nouveau
  • Messages: 4
    • Voir le profil
Bonjours a tous, je créer un TDM mais j'ai cette erreur qui appareit :
Code: (pawn) [Sélectionner]
error 017: undefined symbol "SetPlayerTeamFromClass"

Voici le code :

[code=pawn] // Defines & includes

#define FILTERSCRIPT
#include <a_samp>

// Teams Defines

#define team_Grove   1
#define team_Ballas  2
#define team_Police  3
#define team_Mafia   4

// Couleurs des Teams

#define COLOR_team_Grove 0x00FF00FF
#define COLOR_team_Ballas 0x8000FFFF
#define COLOR_team_Police 0x015CCBFF
#define COLOR_team_Mafia 0xFF0000FF

// Variable

new pTeam[MAX_PLAYERS];

// Début du Script

#if defined FILTERSCRIPT

main()
{
print("\n----------------------------------");
print(" Teams");
print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
SetGameModeText("Blank Script");
AddPlayerClass(105, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(106, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(107, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(102, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(103, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(104, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(281, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(282, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(283, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(285, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(287, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(124, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(125, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(113, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
SetPlayerTeamFromClass(playerid, classid);

if(classid == 1) return pTeam[playerid] = team_Grove;
if(classid == 2) return pTeam[playerid] = team_Ballas;
if(classid == 3) return pTeam[playerid] = team_Police;
if(classid == 4) return pTeam[playerid] = team_Mafia;
return 1;
}

public OnPlayerConnect(playerid)
{
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
return 1;
}

« Modifié: 01 Décembre 2013, 09:42:01 par D4rK Fre4K »

Hors ligne jerem428

  • *
  • Tueur en série
  • Messages: 143
    • Voir le profil
Re : [ERREUR] error 017: undefined symbol "SetPlayerTeamFromClass"
« Réponse #1 le: 24 Novembre 2013, 11:30:18 »
bonjours , ton code fait plusieurs  lignes tu aurai dût le mettre en Pastebin.

[quote]
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerTeamFromClass(playerid, classid);
    return 1;
}[/quote]

[quote]
SetPlayerTeamFromClass(playerid, classid)
{
    if(classid == 0) return pTeam[playerid] = team_Grove;
    else if(classid == 1) return pTeam[playerid] = team_Ballas;
    else if(classid == 2) return pTeam[playerid] = team_Police;
    else if(classid == 3) return pTeam[playerid] = team_Mafia;

}[/quote]
utilise else if et non if au prochaine team.
Ensuite le classid commence de 0 et non de 1.
Ensuite chaque classid correspond à 1 addplayerclass. seul les 4 premiers addplayerclass sont utilisés

Hors ligne ShaDowxx™

  • We are cats.
  • *
  • Grand Banditisme
  • Messages: 706
    • Voir le profil
Re : [ERREUR] error 017: undefined symbol "SetPlayerTeamFromClass"
« Réponse #2 le: 24 Novembre 2013, 15:33:41 »
De nos jours, on utilise plus cette fonction mais plutôt celle-ci