Jump to content
View in the app

A better way to browse. Learn more.

Forum Supreme-Elite

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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
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 nom
du sons sur le t'chat, la limite serais environs 10 ou 15 sons, à la fin du round il faudrait que le sons en
question 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.

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]);
	}
}

  • Author

Merci !!!

 

Pourquoi à corriger il y à un problème actuellement sur ce plugin ?

  • Author

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 by Takuro

  • Author

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

#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 by Fankine

  • Author

D'accord merci beaucoup, en y pensant, il faut que je me mette apprendre le sourcespawn :), je vais le tester.

  • Author

Problème,

 

il flood le chat maintenant :

 

 

Pour activer ou desactiver le son, tapez /active

Pour activer ou desactiver le son, tapez /active
Pour activer ou desactiver le son, tapez /active
Pour activer ou desactiver le son, tapez /active
Pour activer ou desactiver le son, tapez /active
Pour activer ou desactiver le son, tapez /active
Pour activer ou desactiver le son, tapez /active
Pour activer ou desactiver le son, tapez /active
Pour activer ou desactiver le son, tapez /active
Pour activer ou desactiver le son, tapez /active
Pour activer ou desactiver le son, tapez /active
Pour activer ou desactiver le son, tapez /active
Pour activer ou desactiver le son, tapez /active
Pour activer ou desactiver le son, tapez /active
Pour activer ou desactiver le son, tapez /active
Pour activer ou desactiver le son, tapez /active
Pour activer ou desactiver le son, tapez /active

 

il n'as pas l'air de lancer la musique ...

  • Author

Merci de ton aide, mais le problème est que je ne sais pas coder donc ça va être pour moi niveau modification ....

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.