Aller au contenu
News ticker
  • Bienvenue sur le nouveau forum VeryGames
  • Welcome to the new VeryGames forum
  • VeryNews

    Demande plugin !he / !smoke


    SnoX

    Messages recommandés

    Bonjour,

     

    Je cherche un plugin pour give une he par round pour les VIP avec le flag o en tapant !he

    Et un plugin !smoke qui donne une smoke à tous le monde et que les VIP peuvent faire 2 fois

     

    Si quelqu'un a sa serai sympas.

    Si j'ai pas été asser clair demandé moi des explications

     

    Merci d'avance.

    Lien vers le commentaire
    Partager sur d’autres sites

    Nitroxyde ton plugin ne fonctionneras pas correctement, je le refait et j'explique le pourquoi.

     

    Tu déclare une variable globale pour la HE et la SMOKE, seulement cette variable est générale, tu doit faire une variable pour le client.

     

    Je fait le code et je te montre.

     

    EDIT : Si c'est deux utilisation combinée dit le, Nitroxyde compare ton code :$

     

    #include <sourcemod>
    #include <sdktools>
    #include <morecolors>
    
    new g_iCountHE[MAXPLAYERS+1];
    new g_iCountSmoke[MAXPLAYERS+1];
    
    public OnPluginStart()
    {
       HookEvent("round_start", Event_RoundStart)
    
       RegConsoleCmd("sm_he", CMD_He);
       RegConsoleCmd("sm_smoke", CMD_Smoke);
    }
    
    public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
    {
       for (new i = 1; i <= MaxClients; i++)
       {
           if(IsClientInGame(i))
           {
               g_iCountHE[i] = 0;
               g_iCountSmoke[i] = 0;
           }
       }
    }
    
    public Action:CMD_He(client, args)
    {
       if(IsClientInGame(client))
           return Plugin_Handled;
    
       if(!IsPlayerAlive(client))
           return Plugin_Handled;
    
       if(GetClientTeam(client) < 2)
           return Plugin_Handled;
    
       if(GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
       {
           if(g_iCountHE[client] > 2)
           {
               g_iCountHE[client]++;
               GivePlayerItem(client, "weapon_he");
           }
           else
               CPrintToChat(client, "{lightgreen}[VIP] {green}Attendez le prochain round");
       }
       else
           CPrintToChat(client, "{lightgreen}[VIP] {green}Vous devez être VIP");
    
       return Plugin_Handled;
    }
    
    public Action:CMD_Smoke(client, args)
    {
       if(IsClientInGame(client))
           return Plugin_Handled;
    
       if(!IsPlayerAlive(client))
           return Plugin_Handled;
    
       if(GetClientTeam(client) < 2)
           return Plugin_Handled;
    
       if(GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
       {
           if(g_iCountSmoke[client] > 2)
           {
               g_iCountSmoke[client]++;
               GivePlayerItem(client, "weapon_smokegrenade");
           }
           else
               CPrintToChat(client, "{lightgreen}[VIP] {green}Attendez le prochain round");
       }
       else
           CPrintToChat(client, "{lightgreen}[VIP] {green}Vous devez être VIP");
    
       return Plugin_Handled;
    }
    

    Modifié par Kriax
    Lien vers le commentaire
    Partager sur d’autres sites

    Nan essaye ça : xDD

     

    #include <sourcemod>
    #include <sdktools>
    #include <morecolors>
    
    new g_iCount[MAXPLAYERS+1];
    
    public OnPluginStart()
    {
       HookEvent("round_start", Event_RoundStart)
    
       RegConsoleCmd("sm_he", CMD_He);
       RegConsoleCmd("sm_smoke", CMD_Smoke);
    }
    
    public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
    {
       for (new i = 1; i <= MaxClients; i++)
       {
           if(IsClientInGame(i))
           {
               g_iCount[i] = 0;
           }
       }
    }
    
    public Action:CMD_He(client, args)
    {
       if(IsClientInGame(client))
           return Plugin_Handled;
    
       if(!IsPlayerAlive(client))
           return Plugin_Handled;
    
       if(GetClientTeam(client) < 2)
           return Plugin_Handled;
    
       if(GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
       {
           if(g_Count[client] < 2)
           {
               g_iCount[client]++;
               GivePlayerItem(client, "weapon_hegrenade");
           }
           else
               CPrintToChat(client, "{lightgreen}[VIP] {green}Attendez le prochain round");
       }
       else
           CPrintToChat(client, "{lightgreen}[VIP] {green}Vous devez être VIP");
    
       return Plugin_Handled;
    }
    
    public Action:CMD_Smoke(client, args)
    {
       if(IsClientInGame(client))
           return Plugin_Handled;
    
       if(!IsPlayerAlive(client))
           return Plugin_Handled;
    
       if(GetClientTeam(client) < 2)
           return Plugin_Handled;
    
       if(GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
       {
           if(g_CountSmoke[client] < 2)
           {
               g_iCount[client]++;
               GivePlayerItem(client, "weapon_smokegrenade");
           }
           else
               CPrintToChat(client, "{lightgreen}[VIP] {green}Attendez le prochain round");
       }
       else
           CPrintToChat(client, "{lightgreen}[VIP] {green}Vous devez être VIP");
    
       return Plugin_Handled;
    }

    Lien vers le commentaire
    Partager sur d’autres sites

    Rejoindre la conversation

    Vous pouvez publier maintenant et vous inscrire plus tard. Si vous avez un compte, connectez-vous maintenant pour publier avec votre compte.

    Invité
    Répondre à ce sujet…

    ×   Collé en tant que texte enrichi.   Coller en tant que texte brut à la place

      Seulement 75 émoticônes maximum sont autorisées.

    ×   Votre lien a été automatiquement intégré.   Afficher plutôt comme un lien

    ×   Votre contenu précédent a été rétabli.   Vider l’éditeur

    ×   Vous ne pouvez pas directement coller des images. Envoyez-les depuis votre ordinateur ou insérez-les depuis une URL.

    ×
    ×
    • Créer...