Table des matières

Les tutos

Installation du plugin sourcemod :

Plus tard…

Le gestionnaire AFK :

Le gestionnaire d'équilibrage de team automatique :

Mettre les flags qu'on doit prendre à 2 à 1 quand on est seul dans la team :

Obliger les gens à prendre des flags

Le but du jeu étant de prendre tout les flags, certaines personnes s'amusent à faire que du frag, ce plugin kick automatiquement les gens au bout d'un certain nombre de frag si ils n'ont pas de flag.

Votemap :

Install de base :

Install avec 2 mapcycle :

Rock the vote

Une protection pour les gens qui respawn :

Les Anti-Cheats :

Hier je me suis fait un nouveau copain, un que j'avais déjà bien regardé en spectateur tellement j'aime ça façon de jouer…Non non, ce n'est pas de l'ironie du tout. :-) Il faut toujours garder ses ennemis proches de soi. :-) Il est passé sur mon serveur, j'ai play, il a fait marcher son cheat…Je mets ma première map de foot, ça va…Je mets la deuxième, mais normalement quand on marque un but, toute l'équipe adverse meurt, mais pas lui!!! Je dis rien…je fait semblant de m'amuser…je discute avec lui…lui sort les verres du nez et j'apprend qu'il peut plus aller chez les KZN.

  1. On télécharge l'anticheat officiel : Le Zip.
  2. On le décompresse et on l'envoie sur le serveur.
  3. On change de map une fois pour qu'il soit chargé et qu'il créé le fichier de configuration.
  4. On edit : cfg/sourcemod/lilac_config.cfg
  5. On modifie :
    lilac_convar "0"
  6. On change de map pour que les modifs soient prises en compte et c'est fini, c'était pas si compliqué. :-)

Si vous aimez autant que moi ces SUPER amis (cheaters de merde!!!) n'hésitez pas à tout installer. :-)

Script de son automatique

Le Plugin joue un son toute les X secondes, il suffit de changer les sons dans le script. Ce script gère aussi les ajouts de téléchargement des sons.

Pour le compiler : ICI.

#include <sourcemod> 
#include <sdktools> 
#define MAX_FILE_LEN 150

//===== [ PLUGIN INFO ] ==============
public Plugin:myinfo = 
{
	name = "Random server sound",
	author = "Micmacx",
	description = "Play random sounds every xx seconds",
	version = "beta",
	url = "https://dods.neyone.fr"
};
char g_sSounds[][] = 
{
	"music_badboys_light.mp3", 
	"music_blackbetty1.mp3", 
	"music_bombastic.mp3", 
	"music_ca_mexcite.mp3", 
	"music_eisbaer.mp3", 
	"music_every_breath_you_take.mp3", 
	"music_gottafeeling.mp3", 
	"music_harlemshakesource.mp3", 
	"music_Jaime_regarder_les_filles.mp3", 
	"music_new_wave.mp3", 
	"music_u2_sunday_bloody_sunday.mp3", 
	"music_watchtower.mp3", 
	"music_zz_top_gimme_all_your_lovin.mp3",
	"15cartes.mp3", 
	"5e_bierre.mp3", 
	"ah_la_boulette.mp3", 
	"arreter_de_parler_v3.mp3", 
	"balance_le_film.mp3", 
	"beau_pere.mp3", 
	"ben_c_est_le_pire.mp3", 
	"Benoit_Poelvoorde.mp3", 
	"bernie_malin.mp3", 
	"bibiche.mp3", 
	"bienvenue.mp3", 
	"Boire_avec_moderation.mp3", 
	"boire.mp3", 
	"bonboulot.mp3", 
	"bonjour_au_nouveau.mp3", 
	"bonjour_mamie.mp3", 
	"bonjour_sp.mp3", 
	"bonne_nuit_mamie.mp3", 
	"cadeau.mp3", 
	"ca_deboucherais_un_chiotte.mp3", 
	"cafe.mp3", 
	"carjacker.mp3", 
	"cdcaieu.mp3", 
	"cdcbandedebleusail.mp3", 
	"cdccaca.mp3", 
	"cdccavapas.mp3", 
	"cdccouilles.mp3", 
	"cdccul.mp3", 
	"cdcdieu2.mp3", 
	"cdcdsl.mp3", 
	"cdcecran.mp3", 
	"cdcencule.mp3", 
	"cdcmanchedanslamotte.mp3", 
	"cdcplaire.mp3", 
	"cdcsalope.mp3", 
	"cdcsalut.mp3", 
	"cdcschwarzy.mp3", 
	"cdctujouiras.mp3", 
	"cdcvatefairepomper.mp3", 
	"cdczicwar.mp3", 
	"c_est_pas_faux2.mp3", 
	"cette_fille_est_la_preuve_que_dieu_existe.mp3", 
	"chariotte_diable.mp3", 
	"cheminee.mp3", 
	"chier_liquide.mp3", 
	"chinois_de_chine.mp3", 
	"chirac_jai_nique_couillemolle.mp3", 
	"coiffe_normalement.mp3", 
	"congeler_mon_sperme.mp3", 
	"couilles.mp3", 
	"couteaux_cul.mp3", 
	"cuisine_menage.mp3", 
	"darkvador.mp3", 
	"deesse.mp3", 
	"defoncer_la_gueule.mp3", 
	"deja_mort2.mp3", 
	"diner_de_cons.mp3", 
	"donnez_moi_l_ordre.mp3", 
	"ecouterais.mp3", 
	"et_mes_seins_c_est_des_vrais.mp3", 
	"fais_moi_l_amour.mp3", 
	"faut_pas_forcer.mp3", 
	"faux_culs.mp3", 
	"futur_humanite.mp3", 
	"gateaux.mp3", 
	"genievre.mp3", 
	"geo_tuche.mp3", 
	"godlike2.mp3", 
	"gras_cadavre.mp3", 
	"hemoroides.mp3", 
	"herman.mp3", 
	"jacouille_malades2.mp3", 
	"jacouille_malades.mp3", 
	"j_ecoutais_pas.mp3", 
	"j_en_ai_rien_a_foutre.mp3", 
	"je_suis_le_pape.mp3", 
	"Je_te_jure_que_je_ne_faisais_pas_laccent_belge.mp3", 
	"je_travaille_pas_je_suis_patron.mp3", 
	"jingle_goodmorn.mp3", 
	"jingle_sebastien_fermer_ta_gueule.mp3", 
	"justin_merde.mp3", 
	"kiss_my_ass.mp3", 
	"langue_dtc.mp3", 
	"lesconscaosetout.mp3", 
	"louis_martiens.mp3", 
	"mains_maryline.mp3", 
	"mais_enfin_son_pere_etait_nazi.mp3", 
	"ma_meilleure_amie_est_prof_de_MMA.mp3", 
	"mandela_divorce.mp3", 
	"merde_de_chien.mp3", 
	"mousse_cheveux.mp3", 
	"narcolepsie.mp3", 
	"neuneu.mp3", 
	"noel_comme_frites.mp3", 
	"parle_chti.mp3", 
	"partage.mp3", 
	"pas_de_bras.mp3", 
	"plaire.mp3", 
	"poelvoorde_clignotant.mp3", 
	"poulet.mp3", 
	"poutre.mp3", 
	"qui_c_est_nous.mp3", 
	"raciste.mp3", 
	"ramonage.mp3", 
	"reveillon.mp3", 
	"saloppe_diner.mp3", 
	"sauce_secrete.mp3", 
	"sex.mp3", 
	"suppo.mp3", 
	"ta_haine_ta_rendu_plus_puissantv2.mp3", 
	"tasdemerde.mp3", 
	"tiredanslespawn.mp3", 
	"tisane.mp3", 
	"travailler.mp3", 
	"trois_freres_huissier.mp3", 
	"tropcalme.mp3", 
	"tuche_boudin_canon.mp3", 
	"tuches_cuisine_elysee.mp3", 
	"tuches_les_amiches.mp3", 
	"tuches_presidentielles.mp3", 
	"tuches_sept_pour_cent.mp3", 
	"tu_degages.mp3", 
	"tu_mattes_mes_seins.mp3", 
	"tu_sais_pas_jouer_jack.mp3", 
	"un_doigt_dans_les_fesses.mp3", 
	"vite_emmerde.mp3", 
	"voice_dslecul.mp3", 
	"voice_jeteniquetamere.mp3", 
	"voice_saute_pont.mp3", 
	"whisky_doigt.mp3", 
	"you_are_so_french_toi_aussi.mp3"
};

public void OnMapStart()
{
	decl String:buffer[ MAX_FILE_LEN ];
	for (int i = 0; i < sizeof(g_sSounds); i++)
	{
		Format( buffer, MAX_FILE_LEN, "sound/multimod/%s", g_sSounds[i] ); //remplacer par "sound/ton_répertoire_de_sons/%s"
		AddFileToDownloadsTable( buffer);
		Format( buffer, MAX_FILE_LEN, "multimod/%s", g_sSounds[i] ); //Remplacer "multimod/%s" par "ton_répertoire_de_sons/%s" de sons.
		PrecacheSound(buffer, true); // Precache sound file... 
	}
	CreateTimer(60.0, tTimerRandomSound, _, TIMER_FLAG_NO_MAPCHANGE | TIMER_REPEAT); // Changer la valeur 60.0 pour un son toute les minutes.
}

public Action tTimerRandomSound(Handle timer)
{
	decl String:buffer[ MAX_FILE_LEN ];
	int random = GetRandomInt(0, sizeof(g_sSounds) - 1);
	Format( buffer, MAX_FILE_LEN, "multimod/%s", g_sSounds[random] ); //Remplacer "multimod/%s" par "ton_répertoire_de_sons/%s" de sons.
	EmitSoundToAll(buffer);
}

Mémo Scripts

Caractère Description %s %c %i %d %x %f %N %b %u

%s - chaîne :

new MyString:xz[] = "test";
PrintToServer("%s", xz); // или можно сразу PrintToServer(xz);

%c - 1 caractère :

public OnPluginStart()
{
    new MyChar = 'w';
    PrintToServer("-> %c", MyChar);
 
    new String:MyString[] = "abcdefg";
    new symbols = strlen(MyString);
    for (new i = 0; i < symbols; i++)
    {
        PrintToServer("abcdefg[%d] = %c", i, MyString[i]);
        if (MyString[i] == '.') {
            PrintToServer("это точка!");
        }
    }
}

%i ou %d est un entier :

new MyNum = 5;
PrintToServer("%d %i", MyNum, MyNum);


%x %b %u

public OnPluginStart()
{
     new Handle:PluginHandle = GetMyHandle();
     PrintToServer("PluginHandle = %x", PluginHandle);
     PrintToServer("PluginHandle = %b", PluginHandle);
     PrintToServer("PluginHandle = %u", PluginHandle);
}

%f - nombre avec point :

public OnPluginStart()
{
     new Float:MyFloat = 1.5;
     PrintToServer("%f", MyFloat);
     PrintToServer("%5.f", MyFloat);
     PrintToServer("%.1f", MyFloat);
}

%N - pseudo du joueur (peut être utilisé à la place de GetClientName) :

PrintToChat(client, "Ваш ник: %N", client);

Pour afficher le symbole % (pourcentage) dans le chat/console , écrivez ceci : PrintToServer("%%");


OnClientConnect - Use this if you want to prevent clients from connecting. Note: You do not have a client's SteamID or admin status at this point, so it is of limited use. If you absolutely need to block clients from connecting based on their SteamID, see the Connect (TF2) and CBaseServer (everything else) extensions and their OnClientPreConnect forward.
OnClientConnected - Use this if you just want to know when a client connects. Useful for resetting data for a client index, such as in an array.
OnClientAuthorized - Use this if you want to track clients by Steam ID. Don't use this for anything admin related. May occur before or after OnClientPutInServer
OnClientPutInServer - Use this if you want to track when a client is able to actually play the game. May occur before or after OnClientAuthorized
OnClientPreAdminCheck - Use this if you want to override admin checks for a client. If you block a standard admin check here, you must call NotifyPostAdminCheck or plugins that rely on OnClientPostAdminCheck will break.
OnClientPostAdminFilter - Use this if you want to change admin permissions for connecting users.
OnClientPostAdminCheck - Use this if you just want to check if a person is an admin. It's also recommended you use this instead of OnClientAuthorized for SteamID related functions.

Evolution des fonctions :

FindSendPropOffs             --> FindSendPropInfo sans rien changer. 
FindDataMapOffs              --> FindDataMapInfo sans rien changer.
GetClientAuthString(w,x,y,z) --> GetClientAuthId(w,AuthId_Engine ,x,y,z) Simplement ajouter :"AuthId_Engine".

Enum

Ca :

enum wQuest
{
	qACT,
	qValue,
	qTARGETS[5],
	qWEAPON,
	qAWARD[6],
	qTYPE
};
Example:
Code:
int QuestInfo[][wQuest] =
{
	{0,0,{0,0,0,0,0},0,{0,0,0,0,0,0},0},
	{1,1,{73,0,0,0,0},0,{0,0,70,0,0,0},4},
	{2,1,{23,3,5,0,0},0,{0,3,10,6,0,0},4},
	{3,1,{13,0,0,0,0},0,{0,0,50,0,0,0},4},
}

devient :

enum struct wQuest
{
	int qACT;
	int qValue;
	int qTARGETS[5];
	int qWEAPON;
	int qAWARD[6];
	int qTYPE;
}


// This only works in SM 1.11
// In 1.10, need to set arraysize to 4 and initiaze each one by accessing members in a function like OnPluginStart
wQuest QuestInfo[] =
{
	{0,0,{0,0,0,0,0},0,{0,0,0,0,0,0},0},
	{1,1,{73,0,0,0,0},0,{0,0,70,0,0,0},4},
	{2,1,{23,3,5,0,0},0,{0,3,10,6,0,0},4},
	{3,1,{13,0,0,0,0},0,{0,0,50,0,0,0},4},
}

// Access like this:
QuestInfo[index].qACT
QuestInfo[index].qAWARD
// ... etc