coti963

Membres
  • Compteur de contenus

    39
  • Points

  • Inscription

  • Dernière visite

Réputation sur la communauté

0 Neutre

À propos de coti963

  • Rang
    Membre

Compétences

  • Pawn
  • Web front-end
  • Web back-end
  • Mapping
  • Réseau
  • Graphisme
  1. Voici le code : Corrupt_Check[playerid]++; new DB_Query[512]; mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `PLAYERS` SET `SCORE` = %d, `ARGENT` = %d, `KILLS` = %d, `MORTS` = %d, `ADMIN` = %d, `DUTY` = %d, `VIP` = %d, `SKIN` = %d, `INTDM` = %d, `TETE` = %d, `GPS` = %d, `BRIQUET` = %d, `CIGARETTE` = %d, `BOITEOUTILS` = %d, `GLACIERE` = %d, `DROGUE` = %d, `WARN` = %d, `ARGENTBANQUE` = %d WHERE `ID` = %d LIMIT 1", JoueurInfo[playerid][Score], JoueurInfo[playerid][Argent], JoueurInfo[playerid][Kills], JoueurInfo[playerid][Morts], JoueurInfo[playerid][Admin], JoueurInfo[playerid][Duty], JoueurInfo[playerid][Vip], JoueurInfo[playerid][Skin], JoueurInfo[playerid][InTDM], JoueurInfo[playerid][Tete], JoueurInfo[playerid][GPS], JoueurInfo[playerid][Briquet], JoueurInfo[playerid][Cigarette], JoueurInfo[playerid][BoiteOutils], JoueurInfo[playerid][Glaciere], JoueurInfo[playerid][Drogue], JoueurInfo[playerid][Warn], JoueurInfo[playerid][ArgentBanque], JoueurInfo[playerid][ID]); mysql_tquery(Database, DB_Query); if(cache_is_valid(JoueurInfo[playerid][Player_Cache])) { cache_delete(JoueurInfo[playerid][Player_Cache]); JoueurInfo[playerid][Player_Cache] = MYSQL_INVALID_CACHE; } JoueurInfo[playerid][LoggedIn] = false; print("OnPlayerDisconnect a été appelé.");
  2. J'ai un autre problème, quand je me connecte tout ce passe bien, sauf que cela n'enregistre pas mes données quand je me déconnecte
  3. Ahhh, je viens de comprendre, merci
  4. Aucun préfixe ? Tu veux dire quoi par la ? Je prends en compte ta recommandation
  5. Ahhhhh mais oui, suis-je bête, en plus je l'avais mis lors de la connection.... Maintenant ça marche, merci.
  6. Je sais mais sa marche quand même, sauf que j'ai pas de message disant que je suis pas logué au serveur une fois que j'ai rentré mon mot de passe
  7. Un U.B ? Le tableau TeamCrips et TeamBloods je peux les supprimer en faite car je peux les remplacer par gTeam[playerid] == TEAM_BLOODS et gTeam[playerid] == TEAM_CRIPS TeamCripsDepart et TeamBloodsDepart servent a lancer le timer lorsqu'il y a une personne dans chaque équipe MiniTDM sert a définir si le Mini TDM est joignable ou pas Et le playerid dans TimerMiniTDM je pense pour les joueurs qui sont concerné pour le mini tdm Et non je n'ai pas pensé a schématiser sur un papier, c'est une bonne idée, merci du conseil
  8. Oui pas de soucis #define TEAM_CRIPS 7 //pour le mini tdm #define TEAM_BLOODS 8 //pour le mini tdm static gTeam[MAX_PLAYERS]; #define DIALOG_TDM 12 new TeamCrips[MAX_PLAYERS]; new TeamBloods[MAX_PLAYERS]; new TeamCripsDepart = 0; new TeamBloodsDepart = 0; new MortCrips; new MortBloods; new MiniTDM; // 0= personne dessus 1= On peux rejoindre 2= En cours new Float:RandomSpawnMiniTDMTeam1[][] = { {3834.6069,-985.7015,18.8859,295.3396}, // spawn1base1 {3844.0969,-959.8340,18.8859,168.2296}, // spawn1base2 {3832.1255,-977.5585,13.0859,258.5749}, // spawn1base3 {3832.7534,-960.4158,13.0859,247.2136} }; new Float:RandomSpawnMiniTDMTeam2[][] = { {3728.7180,-1160.3756,13.0859,81.5053}, // spawn2base1 {3729.1594,-1175.4899,13.0859,75.4475}, // spawn2base2 {3723.6282,-1152.7416,18.8859,93.8066}, // spawn2base3 {3721.4351,-1179.6157,18.8859,48.7907} }; forward TimerMiniTDM(playerid); public TimerMiniTDM(playerid) { if(TeamCrips[playerid] == 1) { new randTeamCrips = random(sizeof(RandomSpawnMiniTDMTeam1)); SetPlayerVirtualWorld(playerid, 2); SetPlayerPos(playerid, RandomSpawnMiniTDMTeam1[randTeamCrips][0],RandomSpawnMiniTDMTeam1[randTeamCrips][1],RandomSpawnMiniTDMTeam1[randTeamCrips][2]); SetPlayerFacingAngle(playerid, RandomSpawnMiniTDMTeam1[randTeamCrips][3]); gTeam[playerid] = TEAM_CRIPS; SetPlayerInterior(playerid, 5); ResetPlayerWeapons(playerid); SetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 100); GivePlayerWeapon(playerid, 24, 300); GivePlayerWeapon(playerid, 26, 100); GivePlayerWeapon(playerid, 29, 150); GivePlayerWeapon(playerid, 31, 150); GivePlayerWeapon(playerid, 34, 50); GivePlayerWeapon(playerid, 16, 5); } if(TeamBloods[playerid] == 1) { new randTeamBloods = random(sizeof(RandomSpawnMiniTDMTeam2)); SetPlayerVirtualWorld(playerid, 2); SetPlayerPos(playerid, RandomSpawnMiniTDMTeam2[randTeamBloods][0],RandomSpawnMiniTDMTeam2[randTeamBloods][1],RandomSpawnMiniTDMTeam2[randTeamBloods][2]); SetPlayerFacingAngle(playerid, RandomSpawnMiniTDMTeam2[randTeamBloods][3]); gTeam[playerid] = TEAM_BLOODS; SetPlayerInterior(playerid, 5); ResetPlayerWeapons(playerid); SetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 100); GivePlayerWeapon(playerid, 24, 300); GivePlayerWeapon(playerid, 26, 100); GivePlayerWeapon(playerid, 29, 150); GivePlayerWeapon(playerid, 31, 150); GivePlayerWeapon(playerid, 34, 50); GivePlayerWeapon(playerid, 16, 5); } MiniTDM = 2; return 1; } Public OnPlayerSpawn(playerid) { if(TeamCrips[playerid] == 1) { new randTeamCrips = random(sizeof(RandomSpawnMiniTDMTeam1)); SetPlayerVirtualWorld(playerid, 2); SetPlayerPos(playerid, RandomSpawnMiniTDMTeam1[randTeamCrips][0],RandomSpawnMiniTDMTeam1[randTeamCrips][1],RandomSpawnMiniTDMTeam1[randTeamCrips][2]); SetPlayerFacingAngle(playerid, RandomSpawnMiniTDMTeam1[randTeamCrips][3]); gTeam[playerid] = TEAM_CRIPS; ResetPlayerWeapons(playerid); SetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 100); GivePlayerWeapon(playerid, 24, 300); GivePlayerWeapon(playerid, 26, 100); GivePlayerWeapon(playerid, 29, 150); GivePlayerWeapon(playerid, 31, 150); GivePlayerWeapon(playerid, 34, 50); GivePlayerWeapon(playerid, 16, 5); } if(TeamBloods[playerid] == 1) { new randTeamBloods = random(sizeof(RandomSpawnMiniTDMTeam2)); SetPlayerVirtualWorld(playerid, 2); SetPlayerPos(playerid, RandomSpawnMiniTDMTeam2[randTeamBloods][0],RandomSpawnMiniTDMTeam2[randTeamBloods][1],RandomSpawnMiniTDMTeam2[randTeamBloods][2]); SetPlayerFacingAngle(playerid, RandomSpawnMiniTDMTeam2[randTeamBloods][3]); gTeam[playerid] = TEAM_BLOODS; ResetPlayerWeapons(playerid); SetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 100); GivePlayerWeapon(playerid, 24, 300); GivePlayerWeapon(playerid, 26, 100); GivePlayerWeapon(playerid, 29, 150); GivePlayerWeapon(playerid, 31, 150); GivePlayerWeapon(playerid, 34, 50); GivePlayerWeapon(playerid, 16, 5); } return 1; } public OnPlayerDeath(playerid, killerid, reason) { if(gTeam[playerid] == TEAM_CRIPS) { MortCrips ++; } if(gTeam[playerid] == TEAM_BLOODS) { MortBloods ++; } retunr 1; } public OnPlayerUpdate(playerid) { if(MortCrips == 200) { format(string,sizeof(string),"L'équipe Crips a gagné, l'équipe Bloods a perdu avec %d kill",MortCrips); SendClientMessageToAll(COLOR_YELLOW,string); SetPlayerVirtualWorld(playerid, 0); SetPlayerPos(playerid, 1128, -1770, 16.5938); SetPlayerFacingAngle(playerid,90); } if(MortBloods == 200) { format(string,sizeof(string),"L'équipe Bloods a gagné, l'équipe Crips a perdu avec %d kill",MortCrips); SendClientMessageToAll(COLOR_YELLOW,string); SetPlayerVirtualWorld(playerid, 0); SetPlayerPos(playerid, 1128, -1770, 16.5938); SetPlayerFacingAngle(playerid,90); } return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid ==DIALOG_TDM) { if(response) { if(listitem == 0) { if(TeamBloodsDepart == 0) { SendClientMessage(playerid, -1, "Tu dois attendre qu'un Bloods rejoigne la partie pour quelle commence."); } TeamCrips[playerid] = 1; TeamCripsDepart = 1; SetPlayerInterior(playerid, 5); SetPlayerPos(playerid, 1267.663208,-781.323242,1091.906250); SendClientMessage(playerid, -1,"Tu viens de choisir l'équipe Crips"); ResetPlayerWeapons(playerid); } if(listitem == 1) { if(TeamCripsDepart == 0) { SendClientMessage(playerid, -1, "Tu dois attendre qu'un Crips rejoigne la partie pour quelle commence."); } TeamBloods[playerid] = 1; TeamBloodsDepart = 1; SetPlayerInterior(playerid, 5); SetPlayerPos(playerid, 1267.663208,-781.323242,1091.906250); SendClientMessage(playerid, -1,"Tu viens de choisir l'équipe Bloods"); ResetPlayerWeapons(playerid); } } if(TeamCripsDepart && TeamBloodsDepart == 1) { SetTimerEx("TimerMiniTDM", 30000, false, "i", playerid); } return 1; } return 0; } CMD:tdm(playerid, param[]) { if(MiniTDM != 2) { ShowPlayerDialog(playerid, DIALOG_TDM, DIALOG_STYLE_LIST, "{FF0000}Choisi ta team", "Crips\nBloods", "Choisir", "Annuler"); } else { SendClientMessage(playerid, COULEUR_ROUGE, "La partie est en cours, attends quelle soit fini."); } return 1; } PS : Ne pas faire attention a l'indontation, c'est un un bug de copier collé
  9. J'ai changé le Timer mais j'ai toujours le même problème, j'ai qu'un joueur que se fait tp a la map
  10. Bonsoir, lorsque je me connecte, il me demande de rentrer mon mot de passe pour m'enregistrer mais ensuite rien ne se passe et du coup je ne peux pas spawn, screens : Ici il me demande de mettre mon mot de passe pour m'enregistrer : Quand j'appuie sur Register je devrais avoir un message disant que je me suis bien connecté mais il ne s'affche pas du coup je ne peux pas jouer : Le code : #include <a_samp> #include <a_mysql> #include <foreach> main() { print("\n----------------------------------"); print(" Serveur open"); print("----------------------------------\n"); } #define MYSQL_HOST "localhost" #define MYSQL_COMPTE "root" #define MYSQL_MDP "" #define MYSQL_BDD "serveur_samp" #define DIALOG_REGISTER (0) #define DIALOG_LOGIN (1) new MySQL: Database, Corrupt_Check[MAX_PLAYERS]; //============================================================================== enum ENUM_PLAYER_DATA { ID, Name[25], Password[65], Salt[11], PasswordFails, Score, Argent, Admin, Duty, Vip, Skin, Kills, Morts, InTDM, Tete, GPS, Briquet, Cigarette, BoiteOutils, Glaciere, Drogue, Warn, ArgentBanque, Cache: Player_Cache, bool:LoggedIn } new pInfo[MAX_PLAYERS][ENUM_PLAYER_DATA]; //============================================================================== public OnGameModeInit() { new MySQLOpt: option_id = mysql_init_options(); mysql_set_option(option_id, AUTO_RECONNECT, true); Database = mysql_connect(MYSQL_HOST, MYSQL_COMPTE, MYSQL_MDP, MYSQL_BDD, option_id); if(Database == MYSQL_INVALID_HANDLE || mysql_errno(Database) != 0) { print("La base de donné n'a pas réussi à se connecter, le serveur s'éteint."); SendRconCommand("exit"); return 1; } print("La base de donné MySQL est bien connecté."); mysql_tquery(Database, "CREATE TABLE IF NOT EXISTS `PLAYERS` (`ID` int(11) NOT NULL AUTO_INCREMENT,`USERNAME` varchar(24) NOT NULL,`PASSWORD` char(65) NOT NULL,`SALT` char(11) NOT NULL,`SCORE` mediumint(7), `ARGENTBANQUE` mediumint(7), `WARN` mediumint(7), `DROGUE` mediumint(7), `GLACIERE` mediumint(7), `BOITEOUTILS` mediumint(7), `CIGARETTE` mediumint(7), `BRIQUET` mediumint(7), `GPS` mediumint(7), `TETE` mediumint(7), `INTDM` mediumint(7), `SKIN` mediumint(7), `VIP` mediumint(2), `DUTY` mediumint(2), `ADMIN` mediumint(7), `KILLS` mediumint(7), `ARGENT` mediumint(7) NOT NULL DEFAULT '0',`MORTS` mediumint(7) NOT NULL DEFAULT '0', PRIMARY KEY (`ID`), UNIQUE KEY `USERNAME` (`USERNAME`))"); return 1; } public OnGameModeExit() { foreach(new i: Player) { if(IsPlayerConnected(i)) { OnPlayerDisconnect(i, 1); } } mysql_close(Database); return 1; } public OnPlayerConnect(playerid) { new DB_Query[512]; pInfo[playerid][Kills] = 0; pInfo[playerid][Morts] = 0; pInfo[playerid][PasswordFails] = 0; GetPlayerName(playerid, pInfo[playerid][Name], MAX_PLAYER_NAME); // Getting the player's name. Corrupt_Check[playerid]++; mysql_format(Database, DB_Query, sizeof(DB_Query), "SELECT * FROM `PLAYERS` WHERE `USERNAME` = '%e' LIMIT 1", pInfo[playerid][Name]); mysql_tquery(Database, DB_Query, "OnPlayerDataCheck", "ii", playerid, Corrupt_Check[playerid]); return 1; } public OnPlayerDisconnect(playerid, reason) { Corrupt_Check[playerid]++; new DB_Query[256]; mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `PLAYERS` SET `SCORE` = %d, `ARGENT` = %d, `KILLS` = %d, `MORTS` = %d, `ADMIN` = %d, `DUTY` = %d, `VIP` = %d, `SKIN` = %d, `INTDM` = %d, `TETE` = %d, `GPS` = %d, `BRIQUET` = %d, `CIGARETTE` = %d, `BOITEOUTILS` = %d, `GLACIERE` = %d, `DROGUE` = %d, `WARN` = %d, `ARGENTBANQUE` = %d WHERE `ID` = %d LIMIT 1", pInfo[playerid][Score], pInfo[playerid][Argent], pInfo[playerid][Kills], pInfo[playerid][Morts], pInfo[playerid][Admin], pInfo[playerid][Duty], pInfo[playerid][Vip], pInfo[playerid][Skin], pInfo[playerid][InTDM], pInfo[playerid][Tete], pInfo[playerid][GPS], pInfo[playerid][Briquet], pInfo[playerid][Cigarette], pInfo[playerid][BoiteOutils], pInfo[playerid][Glaciere], pInfo[playerid][Drogue], pInfo[playerid][Warn], pInfo[playerid][ArgentBanque], pInfo[playerid][ID]); mysql_tquery(Database, DB_Query); if(cache_is_valid(pInfo[playerid][Player_Cache])) { cache_delete(pInfo[playerid][Player_Cache]); pInfo[playerid][Player_Cache] = MYSQL_INVALID_CACHE; } pInfo[playerid][LoggedIn] = false; print("OnPlayerDisconnect a été appelé."); return 1; } public OnPlayerDeath(playerid, killerid, reason) { if(killerid != INVALID_PLAYER_ID) { pInfo[killerid][Kills]++; pInfo[playerid][Morts]++; } return 1; } public OnPlayerRequestSpawn(playerid) { if(pInfo[playerid][LoggedIn] == false) return 0; return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { switch (dialogid) { case DIALOG_LOGIN: { if(!response) return Kick(playerid); new Salted_Key[65]; SHA256_PassHash(inputtext, pInfo[playerid][Salt], Salted_Key, 65); if(strcmp(Salted_Key, pInfo[playerid][Password]) == 0) { cache_set_active(pInfo[playerid][Player_Cache]); cache_get_value_int(0, "ID", pInfo[playerid][ID]); cache_get_value_int(0, "KILLS", pInfo[playerid][Kills]); cache_get_value_int(0, "MORTS", pInfo[playerid][Morts]); cache_get_value_int(0, "SCORE", pInfo[playerid][Score]); cache_get_value_int(0, "ARGENT", pInfo[playerid][Argent]); cache_get_value_int(0, "ADMIN", pInfo[playerid][Admin]); cache_get_value_int(0, "DUTY", pInfo[playerid][Duty]); cache_get_value_int(0, "VIP", pInfo[playerid][Vip]); cache_get_value_int(0, "SKIN", pInfo[playerid][Skin]); cache_get_value_int(0, "INTDM", pInfo[playerid][InTDM]); cache_get_value_int(0, "TETE", pInfo[playerid][Tete]); cache_get_value_int(0, "GPS", pInfo[playerid][GPS]); cache_get_value_int(0, "BRIQUET", pInfo[playerid][Briquet]); cache_get_value_int(0, "CIGARETTE", pInfo[playerid][Cigarette]); cache_get_value_int(0, "BOITEOUTILS", pInfo[playerid][BoiteOutils]); cache_get_value_int(0, "GLACIERE", pInfo[playerid][Glaciere]); cache_get_value_int(0, "DROGUE", pInfo[playerid][Drogue]); cache_get_value_int(0, "WARN", pInfo[playerid][Warn]); cache_get_value_int(0, "ARGENTBANQUE", pInfo[playerid][ArgentBanque]); SetPlayerScore(playerid, pInfo[playerid][Score]); ResetPlayerMoney(playerid); GivePlayerMoney(playerid, pInfo[playerid][Argent]); cache_delete(pInfo[playerid][Player_Cache]); pInfo[playerid][Player_Cache] = MYSQL_INVALID_CACHE; pInfo[playerid][LoggedIn] = true; SendClientMessage(playerid, 0x00FF00FF, "Vous etes bien connecté."); } else { new String[150]; pInfo[playerid][PasswordFails] += 1; printf("%s n'a pas réussi à se connecter. (%d)", pInfo[playerid][Name], pInfo[playerid][PasswordFails]); if (pInfo[playerid][PasswordFails] >= 3) { format(String, sizeof(String), "%s a été kick Raison: {FF0000}(%d/3) Mauvais mot de passe.", pInfo[playerid][Name], pInfo[playerid][PasswordFails]); SendClientMessageToAll(0x969696FF, String); Kick(playerid); } else { format(String, sizeof(String), "Mot de passe incorrect, vous avez %d sur 3 essais.", pInfo[playerid][PasswordFails]); SendClientMessage(playerid, 0xFF0000FF, String); format(String, sizeof(String), "{FFFFFF}Bienvenue %s.\n\n{0099FF}Ce compte est déjà enregistré.\n\ {0099FF}Veuillez entrer votre mot de passe ci-dessous pour continuer.\n\n", pInfo[playerid][Name]); ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login System", String, "Login", "Leave"); } } } case DIALOG_REGISTER: { if(!response) return Kick(playerid); if(strlen(inputtext) <= 5 || strlen(inputtext) > 60) { SendClientMessage(playerid, 0x969696FF, "Mot de passe trop court, il doit faire 5 caractères minimum."); new String[150]; format(String, sizeof(String), "{FFFFFF}Bienvenue %s.\n\n{0099FF}Vous n'etes pas enregistré.\n\ {0099FF}Veuillez entrer votre mot de passe ci-dessous pour continuer.\n\n", pInfo[playerid][Name]); ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Registration System", String, "Register", "Leave"); } else { for (new i = 0; i < 10; i++) { pInfo[playerid][Salt][i] = random(79) + 47; } pInfo[playerid][Salt][10] = 0; SHA256_PassHash(inputtext, pInfo[playerid][Salt], pInfo[playerid][Password], 65); new DB_Query[225]; mysql_format(Database, DB_Query, sizeof(DB_Query), "INSERT INTO `PLAYERS` (`USERNAME`, `PASSWORD`, `SALT`, `SCORE`, `KILLS`, `ARGENT`, `MORTS`, `ADMIN`, `DUTY`, `VIP`, `SKIN`, `INTDM`, `TETE`, `GPS`, `BRIQUET`, `CIGARETTE`, `BOITEOUTILS`, `GLACIERE`, `DROGUE`, `WARN`, `ARGENTBANQUE`)\ VALUES ('%e', '%s', '%e', '20', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1000')", pInfo[playerid][Name], pInfo[playerid][Password], pInfo[playerid][Salt]); mysql_tquery(Database, DB_Query, "OnPlayerRegister", "d", playerid); } } } return 1; } forward public OnPlayerDataCheck(playerid, corrupt_check); public OnPlayerDataCheck(playerid, corrupt_check) { if (corrupt_check != Corrupt_Check[playerid]) return Kick(playerid); new String[150]; if(cache_num_rows() > 0) { cache_get_value(0, "PASSWORD", pInfo[playerid][Password], 65); cache_get_value(0, "SALT", pInfo[playerid][Salt], 11); pInfo[playerid][Player_Cache] = cache_save(); format(String, sizeof(String), "{FFFFFF}Bienvenue %s.\n\n{0099FF}Ce compte est déjà enregistré.\n\ {0099FF}S'il vous plaît, entrez votre mot de passe ci-dessous pour procéder au jeu.\n\n", pInfo[playerid][Name]); ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login System", String, "Login", "Leave"); } else { format(String, sizeof(String), "{FFFFFF}Bienvenue %s.\n\n{0099FF}Ce compte n'est pas enregistré.\n\ {0099FF}S'il vous plaît, entrez votre mot de passe ci-dessous pour vous connecter.\n\n", pInfo[playerid][Name]); ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Registration System", String, "Register", "Leave"); } return 1; } forward OnPlayerRegister(playerid); public OnPlayerRegister(playerid) { SendClientMessage(playerid, 0x00FF00FF, "Vous êtes maintenant inscrit et connecté."); pInfo[playerid][LoggedIn] = true; return 1; }
  11. new Float:RandomSpawnMiniTDMTeam1[][] = { {3834.6069,-985.7015,18.8859,295.3396}, // spawn1base1 {3844.0969,-959.8340,18.8859,168.2296}, // spawn1base2 {3832.1255,-977.5585,13.0859,258.5749}, // spawn1base3 {3832.7534,-960.4158,13.0859,247.2136} }; J'ai toujours fait comme ceci et je n'ai jamais eu de problème
  12. Euh....Pas compris SetTimerEx("TimerMiniTDM", 30000, false, "i", playerid); Donc je mets comme ceci ?
  13. Bonjour, j'ai créé un TeamDeathMatch sur une map et mon problème c'est que lorsque que l'on est dans la salle d'attente, y'a qu'un joueur qui est tp sur la map et le random du spawn ce produit à l'infini. Voici le code : #define DIALOG_TDM 12 new TeamCrips[MAX_PLAYERS]; new TeamBloods[MAX_PLAYERS]; new TeamCripsDepart = 0; new TeamBloodsDepart = 0; new MortCrips; new MortBloods; new MiniTDM; // 0= personne dessus 1= On peux rejoindre 2= En cours new Float:RandomSpawnMiniTDMTeam1[][] = { {3834.6069,-985.7015,18.8859,295.3396}, // spawn1base1 {3844.0969,-959.8340,18.8859,168.2296}, // spawn1base2 {3832.1255,-977.5585,13.0859,258.5749}, // spawn1base3 {3832.7534,-960.4158,13.0859,247.2136} }; new Float:RandomSpawnMiniTDMTeam2[][] = { {3728.7180,-1160.3756,13.0859,81.5053}, // spawn2base1 {3729.1594,-1175.4899,13.0859,75.4475}, // spawn2base2 {3723.6282,-1152.7416,18.8859,93.8066}, // spawn2base3 {3721.4351,-1179.6157,18.8859,48.7907} }; forward TimerMiniTDM(playerid); public TimerMiniTDM(playerid) { if(TeamCrips[playerid] == 1) { new randTeamCrips = random(sizeof(RandomSpawnMiniTDMTeam1)); SetPlayerVirtualWorld(playerid, 2); SetPlayerPos(playerid, RandomSpawnMiniTDMTeam1[randTeamCrips][0],RandomSpawnMiniTDMTeam1[randTeamCrips][1],RandomSpawnMiniTDMTeam1[randTeamCrips][2]); SetPlayerFacingAngle(playerid, RandomSpawnMiniTDMTeam1[randTeamCrips][3]); gTeam[playerid] = TEAM_CRIPS; SetPlayerInterior(playerid, 5); ResetPlayerWeapons(playerid); SetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 100); GivePlayerWeapon(playerid, 24, 300); GivePlayerWeapon(playerid, 26, 100); GivePlayerWeapon(playerid, 29, 150); GivePlayerWeapon(playerid, 31, 150); GivePlayerWeapon(playerid, 34, 50); GivePlayerWeapon(playerid, 16, 5); } if(TeamBloods[playerid] == 1) { new randTeamBloods = random(sizeof(RandomSpawnMiniTDMTeam2)); SetPlayerVirtualWorld(playerid, 2); SetPlayerPos(playerid, RandomSpawnMiniTDMTeam2[randTeamBloods][0],RandomSpawnMiniTDMTeam2[randTeamBloods][1],RandomSpawnMiniTDMTeam2[randTeamBloods][2]); SetPlayerFacingAngle(playerid, RandomSpawnMiniTDMTeam2[randTeamBloods][3]); gTeam[playerid] = TEAM_BLOODS; SetPlayerInterior(playerid, 5); ResetPlayerWeapons(playerid); SetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 100); GivePlayerWeapon(playerid, 24, 300); GivePlayerWeapon(playerid, 26, 100); GivePlayerWeapon(playerid, 29, 150); GivePlayerWeapon(playerid, 31, 150); GivePlayerWeapon(playerid, 34, 50); GivePlayerWeapon(playerid, 16, 5); } MiniTDM = 2; return 1; } public OnPlayerSpawn(playerid) { if(TeamCrips[playerid] & TeamBloods[playerid] == 1) { TextDrawShowForPlayer(playerid,TextDrawMiniTDM); } if(TeamCrips[playerid] == 1) { new randTeamCrips = random(sizeof(RandomSpawnMiniTDMTeam1)); SetPlayerVirtualWorld(playerid, 2); SetPlayerPos(playerid, RandomSpawnMiniTDMTeam1[randTeamCrips][0],RandomSpawnMiniTDMTeam1[randTeamCrips][1],RandomSpawnMiniTDMTeam1[randTeamCrips][2]); SetPlayerFacingAngle(playerid, RandomSpawnMiniTDMTeam1[randTeamCrips][3]); gTeam[playerid] = TEAM_CRIPS; ResetPlayerWeapons(playerid); SetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 100); GivePlayerWeapon(playerid, 24, 300); GivePlayerWeapon(playerid, 26, 100); GivePlayerWeapon(playerid, 29, 150); GivePlayerWeapon(playerid, 31, 150); GivePlayerWeapon(playerid, 34, 50); GivePlayerWeapon(playerid, 16, 5); } if(TeamBloods[playerid] == 1) { new randTeamBloods = random(sizeof(RandomSpawnMiniTDMTeam2)); SetPlayerVirtualWorld(playerid, 2); SetPlayerPos(playerid, RandomSpawnMiniTDMTeam2[randTeamBloods][0],RandomSpawnMiniTDMTeam2[randTeamBloods][1],RandomSpawnMiniTDMTeam2[randTeamBloods][2]); SetPlayerFacingAngle(playerid, RandomSpawnMiniTDMTeam2[randTeamBloods][3]); gTeam[playerid] = TEAM_BLOODS; ResetPlayerWeapons(playerid); SetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 100); GivePlayerWeapon(playerid, 24, 300); GivePlayerWeapon(playerid, 26, 100); GivePlayerWeapon(playerid, 29, 150); GivePlayerWeapon(playerid, 31, 150); GivePlayerWeapon(playerid, 34, 50); GivePlayerWeapon(playerid, 16, 5); } return 1; } public OnPlayerDeath(playerid, killerid, reason) { if(gTeam[playerid] == TEAM_CRIPS) { MortCrips ++; } if(gTeam[playerid] == TEAM_BLOODS) { MortBloods ++; } return 1; } Public OnPlayerUpdate(playerid) { if(MortCrips == 200) { format(string,sizeof(string),"L'équipe Crips a gagné, l'équipe Bloods a perdu avec %d kill",MortCrips); SendClientMessageToAll(COLOR_YELLOW,string); SetPlayerVirtualWorld(playerid, 0); SetPlayerPos(playerid, 1128, -1770, 16.5938); SetPlayerFacingAngle(playerid,90); } if(MortBloods == 200) { format(string,sizeof(string),"L'équipe Bloods a gagné, l'équipe Crips a perdu avec %d kill",MortCrips); SendClientMessageToAll(COLOR_YELLOW,string); SetPlayerVirtualWorld(playerid, 0); SetPlayerPos(playerid, 1128, -1770, 16.5938); SetPlayerFacingAngle(playerid,90); } return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid ==DIALOG_TDM) { if(response) { if(listitem == 0) { if(TeamBloodsDepart == 0) { SendClientMessage(playerid, -1, "Tu dois attendre qu'un Bloods rejoigne la partie pour quelle commence."); } TeamCrips[playerid] = 1; TeamCripsDepart = 1; SetPlayerInterior(playerid, 5); SetPlayerPos(playerid, 1267.663208,-781.323242,1091.906250); SendClientMessage(playerid, -1,"Tu viens de choisir l'équipe Crips"); ResetPlayerWeapons(playerid); } if(listitem == 1) { if(TeamCripsDepart == 0) { SendClientMessage(playerid, -1, "Tu dois attendre qu'un Crips rejoigne la partie pour quelle commence."); } TeamBloods[playerid] = 1; TeamBloodsDepart = 1; SetPlayerInterior(playerid, 5); SetPlayerPos(playerid, 1267.663208,-781.323242,1091.906250); SendClientMessage(playerid, -1,"Tu viens de choisir l'équipe Bloods"); ResetPlayerWeapons(playerid); } } if(TeamCripsDepart & TeamBloodsDepart == 1) { SetTimer("TimerMiniTDM", 30000, false); } return 1; } return 0; } CMD:tdm(playerid, param[]) { if(MiniTDM != 2) { ShowPlayerDialog(playerid, DIALOG_TDM, DIALOG_STYLE_LIST, "{FF0000}Choisi ta team", "Crips\nBloods", "Choisir", "Annuler"); } else { SendClientMessage(playerid, COULEUR_ROUGE, "La partie est en cours, attends quelle soit fini."); } return 1; }
  14. Aaaahhhhhhhhhhhhh..... Mais le con, pourquoi je n'y ai pas pensé plus tôt, je l'ai fait sur la commande lors de la création de véhicule en plus. Bref, merci beaucoup de votre aide à tous.
  15. Problème réglé, maintenant j'ai toujours un problème qui persiste, les véhicule ne veulent toujours spawn dans le bon monde.