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

    Problème surf rpg deathmatch


    KᐰMKᐰZΣ

    Messages recommandés

    Bonjour

     

    Voila mon problème, j ai un serveur surf rpg deathmatch mais quand j augmente ma health au max donc 190 hp elle se remet automatiquement à 100hp dés que je réapparais après être mort.

    Bien que je mette ça dans le fichier cssdm.equip.txt dans cfg/cssdm/cssdm.equip.txt:

    "AutoItems"

    {

    // Health amount to give (0 to use default from game/other plugin)

    // "health" "0"

    Avez vous une solution svp

     

    Merci

     

    Cordialement

     

    "KᐰM!KᐰZΣ"

    Lien vers le commentaire
    Partager sur d’autres sites

    • 3 weeks later...
    #include <sourcemod>
    
    #pragma semicolon 1
    
    new Handle:cvarSpawnProtect;
    new Handle:cvarAnnounce;
    new Handle:cvarProtectTime;
    
    new clientProtected[MAXPLAYERS+1];
    new clientHP[MAXPLAYERS+1];
    
    //Chat Color Defines
    #define cDefault 0x01
    #define cLightGreen 0x03
    #define cGreen 0x04
    #define cDarkGreen 0x05
    
    #define PLUGIN_VERSION "1.0.0"
    
    public Plugin:myinfo = 
    {
       name = "TF2 Spawn Protection",
       author = "Crimson",
       description = "Protects Player's on Spawn",
       version = PLUGIN_VERSION,
       url = "www.tf2rocketarena.com"
    }
    
    public OnPluginStart()
    {
       CreateConVar("sm_spawnprotect_version", PLUGIN_VERSION, "Spawn Protection Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
       cvarSpawnProtect = CreateConVar("sm_spawnprotect_enable", "1.0", "Activer/Desactiver le plugin", FCVAR_PLUGIN, true, 0.0, true, 1.0);
       cvarAnnounce = CreateConVar("sm_spawnprotect_announce", "1.0", "Activer/Desactiver l'annonce de la protection", FCVAR_PLUGIN, true, 0.0, true, 1.0);
       cvarProtectTime = CreateConVar("sm_spawnprotect_timer", "5.0", "Nombre de seconde du spawn protect", FCVAR_PLUGIN, true, 0.0, true, 30.0);
    
       HookEvent("player_spawn", Event_PlayerSpawn);
       HookEvent("player_hurt", Event_PlayerHurt);    
    } 
    
    public Event_PlayerSpawn(Handle:event,const String:name[],bool:dontBroadcast)
    {
       if (GetConVarFloat(cvarSpawnProtect))
       {
           new client = GetClientOfUserId(GetEventInt(event, "userid"));
    
           CreateTimer(0.1, timer_GetHealth, client);
    
           //Enable Protection on the Client
           clientProtected[client] = 1;
    
           SetEntityRenderMode(client, RENDER_TRANSCOLOR);
           SetEntityRenderColor(client, 0, 0, 205, 100);
    
           CreateTimer(GetConVarFloat(cvarProtectTime), timer_PlayerProtect, client);
       }
    }
    
    public Action:timer_GetHealth(Handle:timer, any:client)
    {
       //Get the Player's Health on Spawning
       if(IsClientConnected(client) && IsClientInGame(client))
       {
           clientHP[client] = GetClientHealth(client);
       }
    }
    
    public Action:timer_PlayerProtect(Handle:timer, any:client)
    {
       //Disable Protection on the Client
       clientProtected[client] = false;
    
       SetEntityRenderColor(client, 255, 255, 255, 255);
       if (GetConVarFloat(cvarAnnounce))
       PrintToChat(client, "%c[spawnProtect] %cVotre protection est maintenant desactiver", cLightGreen, cDefault);
    }
    
    public Event_PlayerHurt(Handle:event,const String:name[],bool:dontBroadcast)
    {
       new client = GetClientOfUserId(GetEventInt(event, "userid"));
    
       if (clientProtected[client] == 1)
           {
               SetEntData(client, FindDataMapOffs(client, "m_iMaxHealth"), clientHP[client], 4, true);
               SetEntData(client, FindDataMapOffs(client, "m_iHealth"), clientHP[client], 4, true);
           }
    }
    

    met celui-ci a la place il marchera avec normalement

    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...