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

Si vous êtes débutant, je vous conseil avant de continuer, de suivre ce tutoriel et de commencer par apprendre les bases avec ce tutoriel très simple à comprendre ici: http://forum.supreme-elite.fr/topic/16635-tuto-comment-d%C3%A9buter-en-sourcespawn/

 

Commençons le tutoriel... 

Avant toute chose, j'insère les includes obligatoire: 

#include <sourcemod>

et je rajoute un autre include qui est: cstrike

#include <cstrike>

Nous allons prendre l'exemple que j'avais posté sur le tutoriel du débutant:

#include <sourcemod>
#include <cstrike>

public Plugin:myinfo =
{
name = "Nom du plugin",
author = "Ton prénom/pseudo",
description = "Description du plugin",
version = "Version de ton plugin",
url = "URL de ton site/twitter"
};


public OnPluginStart()
{
    RegConsoleCmd("sm_test", TestCmd);
}


public Action:TestCmd(client, args)
{
    PrintToChat(client, "Salut tout le monde !");


    return Plugin_Handled;
}  

Désormais, nous allons modifier ce code d'exemple pour restreindre une commande à un FLAG.

 

La première chose à modifier, c'est la variable RegConsoleCmd qui deviendra RegAdminCmd

public OnPluginStart()
{
    RegAdminCmd("sm_test", TestCmd);
}

Ensuite, nous allons procéder au modification entre les parenthèses. C'est très simple, disons que nous voulons restreindre la commande sm_test à l'admin qui a tout les droits donc, le FLAG Z, nous utiliserons ADMFLAG_ROOT (qui est le FLAG Z) et on va insérer cette restriction tout simplement après la déclaration TestCmd (sans oublié la ,):

public OnPluginStart()
{
    RegAdminCmd("sm_test", TestCmd, ADMFLAG_ROOT);
}

Et notre code au complet donnera ça:

#include <sourcemod>
#include <cstrike>

public Plugin:myinfo =
{
name = "Nom du plugin",
author = "Ton prénom/pseudo",
description = "Description du plugin",
version = "Version de ton plugin",
url = "URL de ton site/twitter"
};


public OnPluginStart()
{
    RegAdminCmd("sm_test", TestCmd, ADMFLAG_ROOT);
}


public Action:TestCmd(client, args)
{
    PrintToChat(client, "Je sais désormais restreindre une commande !");


    return Plugin_Handled;
}  

Voici désormais la liste des FLAGS:

ADMFLAG_ROOT (z) 
ADMFLAG_RESERVATION (a)
ADMFLAG_GENERIC ( 
ADMFLAG_KICK (c) 
ADMFLAG_BAN (d) 
ADMFLAG_UNBAN (e) 
ADMFLAG_SLAY (f) 
ADMFLAG_CHANGEMAP (g) 
ADMFLAG_CONVARS (h)
ADMFLAG_CONFIG (i)
ADMFLAG_CHAT (j) 
ADMFLAG_VOTE (k) 
ADMFLAG_PASSWORD (l) 
ADMFLAG_RCON (m) 
ADMFLAG_CHEATS (n) 

ADMFLAG_CUSTOM1 (o)
ADMFLAG_CUSTOM2 (p)
ADMFLAG_CUSTOM3 (q)
ADMFLAG_CUSTOM4 (r)
ADMFLAG_CUSTOM5 (s)
ADMFLAG_CUSTOM6 (t)

Ceci est un tutoriel basique est simple à comprendre.

Pour toutes questions n'hésitez pas à me contacter, je me ferais un plaisir de vous aidez !

 

Je remercie alex30555 pour la liste des FLAGS et je vous conseil de la noter, ça sert toujours.

 

A bientôt pour un nouveau tutoriel ;)

Edited by K4nsuke

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.