November 17, 201411 yr comment_183422 Bonjour, Je vous détail ci dessous ce que je voudrais avoir ( à noter que je ne souhaite pas installer AMXmod) "¢ Pseudo IG : Tàkuro-Ishizaki"¢ SteamID : STEAM_0:0:16467700"¢ Lien vers topic de présentation : http://forum.supreme-elite.fr/topic/17094-pr%C3%A9sentation-takuro-ishizaki/"¢ Nom de la team : Pouletlbche ( sans commentaire )"¢ URL du site/forum de la team : ( Aucun pour l'instant) "¢ Description du plugin souhaité (détaillée a fond) : Je voudrais un plugin qui lance des sons à chaque début de round aléatoirement et en affichant le nomdu sons sur le t'chat, la limite serais environs 10 ou 15 sons, à la fin du round il faudrait que le sons enquestion s'arrête automatique. PS : Si possible sinon ce n'est pas grave, sur le message qui indique le sons jouer, il faudrait qu'il soisécrit ceci : (taper !stop) pour arrêter le sons. et ainsi avoir un commande qui permet de le stoper. Merci d'avance d'avoir lu et je vous souhaite une bonne journée. Report
November 18, 201411 yr comment_183446 Salut,tiens voici le plugin, j'ai pas compilé car je ne peux pas maintenant. Si quelqu'un veut tester et corriger bon lui semble.je donne la source directement, ca va je suis pas trop rouillé mdr. #include <sourcemod> #include <colors> #include <cstrike> #define PLUGIN_VERSION "1.0" new Handle:rd_sound; new Handle:rd_path; new String:path2[200]; new String:str2[254]; new String:arr2[20][30]; new random; new ok[MAXPLAYERS+1]; public Plugin:myinfo = { name = "Random Sound", author = "Dertione", description = "", version = PLUGIN_VERSION, url = "http://forum.supreme-elite.fr/" }; public OnPluginStart() { CreateConVar("rd_version", PLUGIN_VERSION, "", FCVAR_PLUGIN | FCVAR_REPLICATED | FCVAR_NOTIFY); rd_sound = CreateConVar("rd_sound", "I_like_to_move_it loose_your_self", "Remplir par le nom du fichier mp3 sans .mp3 et chaque son séparer par des espaces", FCVAR_PLUGIN); rd_path = CreateConVar("rd_path", "rd/", "le dossier où se trouve les sons automatiquement dans sound/", FCVAR_PLUGIN); AutoExecConfig(true, "rd_sound"); RegConsoleCmd("stop", Command_Stop, "Commande pour stop la musique"); RegConsoleCmd("active", Command_Active, "Commande pour desactiver la musique"); HookEvent("round_start", EventRoundStart, EventHookMode_PostNoCopy); } public OnConfigsExecuted() { new String:str[254]; new String:arr[20][30]; new String:path[200]; new random; /* ON REPREND LA CVAR */ GetConVarString(rd_sound, str, 254); GetConVarString(rd_path, path, 254); new total = ExplodeString(str, " ", arr, 20, 30); if(total == 0) strcopy(arr[total], 30, str); for (new i = 0; i <= total; i++) { Format(path, 254, "%s%s.mp3", path, arr[i]); PrecacheSound(path, true); Format(path, 254, "sound/%s", path); AddFileToDownloadsTable(path); } } public EventRoundStart(Handle:event, const String:name[], bool:dontBroadcast) { CreateTimer(5, StartTimer); for (new i = 1; i <= GetMaxClients(); i++) { CreateTimer(20, RoundTimer, i, TIMER_REPEAT); } } public Action:StartTimer(Handle:timer, any:client) { /* ON REPREND LA CVAR */ GetConVarString(rd_sound, str2, 254); GetConVarString(rd_path, path2, 254); new total = ExplodeString(str, " ", arr2, 20, 30); if(total == 0) strcopy(arr2[total++], 30, str2); random = GetRandomInt(0,19); Format(path2, 254, "%s%s.mp3", path2, arr2[random]); for (new i = 1; i <= GetMaxClients(); i++) { if(IsClientConnected(i) && ok[i]==1) { EmitSoundToClient(client, path2, SOUND_FROM_PLAYER, SNDCHAN_AUTO, SNDLEVEL_GUNFIRE); } } } public Action:RoundTimer(Handle:timer, any:client) { if(ok[i]==1) CPrintToChat(client,"Le son qui est joué est {green}%s.", arr2[random]); CPrintToChat(client,"Pour activer ou desactiver le son, tapez /active", arr2[random]); } public Action:Command_Stop(client, args) { StopSound(client, SNDCHAN_STATIC, arr2[random]); } public Action:Command_Active(client, args) { if(ok[client] == 0) { ok[client] = 1; CPrintToChat(client,"{green} Sound activated next round"); } else { ok[client] = 0; CPrintToChat(client,"{green} Sound desactivated"); StopSound(client, SNDCHAN_STATIC, arr2[random]); } } Report
November 18, 201411 yr Author comment_183481 Merci !!! Pourquoi à corriger il y à un problème actuellement sur ce plugin ? Report
November 18, 201411 yr Author comment_183484 Je viens de compiler mais une erreur survient sur la ligne 120 c'est écris ceci : fatal error 120: cannot read from file: "colors". Edited November 18, 201411 yr by Takuro Report
November 19, 201411 yr comment_183492 Il te manque l'include colors, télécharge le ici et met le dans le fichier scripting/include Report
November 19, 201411 yr Author comment_183502 C'est fait, mais maintenant encore 6 erreurs, je pense que la compil va se faire durement .... screen des erreurs :http://image.noelshack.com/fichiers/2014/47/1416408002-erreur-compil.png Report
November 19, 201411 yr comment_183507 #include <sourcemod> #include <colors> #include <cstrike> #include <sdktools> #define PLUGIN_VERSION "1.0" new Handle:rd_sound; new Handle:rd_path; new String:path2[200]; new String:str2[254]; new String:arr2[20][30]; new random; new ok[MAXPLAYERS+1]; public Plugin:myinfo = { name = "Random Sound", author = "Dertione", description = "", version = PLUGIN_VERSION, url = "http://forum.supreme-elite.fr/" }; public OnPluginStart() { CreateConVar("rd_version", PLUGIN_VERSION, "", FCVAR_PLUGIN | FCVAR_REPLICATED | FCVAR_NOTIFY); rd_sound = CreateConVar("rd_sound", "I_like_to_move_it loose_your_self", "Remplir par le nom du fichier mp3 sans .mp3 et chaque son séparer par des espaces", FCVAR_PLUGIN); rd_path = CreateConVar("rd_path", "rd/", "le dossier où se trouve les sons automatiquement dans sound/", FCVAR_PLUGIN); AutoExecConfig(true, "rd_sound"); RegConsoleCmd("stop", Command_Stop, "Commande pour stop la musique"); RegConsoleCmd("active", Command_Active, "Commande pour desactiver la musique"); HookEvent("round_start", EventRoundStart, EventHookMode_PostNoCopy); } public OnConfigsExecuted() { new String:str[254]; new String:arr[20][30]; new String:path[200]; new random; /* ON REPREND LA CVAR */ GetConVarString(rd_sound, str, 254); GetConVarString(rd_path, path, 254); new total = ExplodeString(str, " ", arr, 20, 30); if(total == 0) strcopy(arr[total], 30, str); for (new i = 0; i <= total; i++) { Format(path, 254, "%s%s.mp3", path, arr[i]); PrecacheSound(path, true); Format(path, 254, "sound/%s", path); AddFileToDownloadsTable(path); } } public EventRoundStart(Handle:event, const String:name[], bool:dontBroadcast) { CreateTimer(5, StartTimer); for (new i = 1; i <= GetMaxClients(); i++) { CreateTimer(20, RoundTimer, i, TIMER_REPEAT); } } public Action:StartTimer(Handle:timer, any:client) { /* ON REPREND LA CVAR */ GetConVarString(rd_sound, str2, 254); GetConVarString(rd_path, path2, 254); new total = ExplodeString(str2, " ", arr2, 20, 30); if(total == 0) strcopy(arr2[total++], 30, str2); random = GetRandomInt(0,19); Format(path2, 254, "%s%s.mp3", path2, arr2[random]); for (new i = 1; i <= GetMaxClients(); i++) { if(IsClientConnected(i) && ok[i]==1) { EmitSoundToClient(client, path2, SOUND_FROM_PLAYER, SNDCHAN_AUTO, SNDLEVEL_GUNFIRE); } } } public Action:RoundTimer(Handle:timer, any:client) { if(ok[client]==1) CPrintToChat(client,"Le son qui est joué est {green}%s.", arr2[random]); CPrintToChat(client,"Pour activer ou desactiver le son, tapez /active", arr2[random]); } public Action:Command_Stop(client, args) { StopSound(client, SNDCHAN_STATIC, arr2[random]); } public Action:Command_Active(client, args) { if(ok[client] == 0) { ok[client] = 1; CPrintToChat(client,"{green} Sound activated next round"); } else { ok[client] = 0; CPrintToChat(client,"{green} Sound desactivated"); StopSound(client, SNDCHAN_STATIC, arr2[random]); } } Rien de bien méchant à modifier, surtout des erreurs d'étourderies (BIEN TU APPELLE DES FONCTIONS DE SDKTOOLS MAIS TU LE MET PAS EN INCLUDE MOMO ?). Cette version compile, à tester sur un serveur cependant. Edited November 19, 201411 yr by Fankine Report
November 19, 201411 yr Author comment_183514 D'accord merci beaucoup, en y pensant, il faut que je me mette apprendre le sourcespawn , je vais le tester. Report
November 19, 201411 yr Author comment_183516 Problème, il flood le chat maintenant : Pour activer ou desactiver le son, tapez /activePour activer ou desactiver le son, tapez /activePour activer ou desactiver le son, tapez /activePour activer ou desactiver le son, tapez /activePour activer ou desactiver le son, tapez /activePour activer ou desactiver le son, tapez /activePour activer ou desactiver le son, tapez /activePour activer ou desactiver le son, tapez /activePour activer ou desactiver le son, tapez /activePour activer ou desactiver le son, tapez /activePour activer ou desactiver le son, tapez /activePour activer ou desactiver le son, tapez /activePour activer ou desactiver le son, tapez /activePour activer ou desactiver le son, tapez /activePour activer ou desactiver le son, tapez /activePour activer ou desactiver le son, tapez /activePour activer ou desactiver le son, tapez /active il n'as pas l'air de lancer la musique ... Report
November 19, 201411 yr comment_183523 Si je peut te conseiller ceci : https://forums.alliedmods.net/showthread.php?p=2128612Avec quelque modification tu pourrais avoir ce que tu veut Report
November 19, 201411 yr Author comment_183524 Merci de ton aide, mais le problème est que je ne sais pas coder donc ça va être pour moi niveau modification .... Report
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.