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

    Roleplay cssrp


    propro

    Messages recommandés

    Bonjour , j'ai un petit soucis avec un code , que j'ai trouvé sur Verygames ( de Kupah )

     

    Voici le code :

     

    #include <sourcemod>
    #include <sdktools>
    
    new Handle:h_timerBoisson[MAXPLAYERS+1] = INVALID_HANDLE,
       Handle:h_timerCafe[MAXPLAYERS+1] = INVALID_HANDLE;
    
    public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
    {
       if (IsPlayerAlive(client))
       {
           new Float:entitypos[3], 
               Float:clientpos[3],
               Entity;
    
           Entity = GetClientAimTarget(client, false);
           GetEntPropVector(Entity, Prop_Send, "m_vecOrigin", entitypos);
           GetEntPropVector(client, Prop_Send, "m_vecOrigin", clientpos);
    
           new Float:distance = GetVectorDistance(entitypos, clientpos);
    
           if(IsMachineBouffe(client))
           {
               if (distance <= 90)
               {
                   MenuBouffe(client);
               }
           }
           else if(IsMachineCafe(client))
           {
               if (distance <= 90)
               {
                   MenuCafe(client);
               }
           }
           else if(IsMachineBoisson(client))
           {
               if (distance <= 90)
               {
                   MenuBoisson(client);
               }
           }
       }
    }
    
    public MenuBouffe(client)
    {
       new Handle:menu = CreateMenu(BouffeMenu);
       SetMenuTitle(menu, "Quelle boisson voulez-vous ?");
       AddMenuItem(menu, "bueno", "Kinder Bueno - 2€");
       AddMenuItem(menu, "m&m", "M&M's - 2€");
       AddMenuItem(menu, "maltesers", "Maltesers - 4€");
       AddMenuItem(menu, "dragibus", "Dragibus - 2€");
       DisplayMenu(menu, client, MENU_TIME_FOREVER);
    }
    
    public MenuCafe(client)
    {
       new Handle:menu = CreateMenu(CafeMenu);
       SetMenuTitle(menu, "Quelle boisson voulez-vous ?");
       AddMenuItem(menu, "cafe", "Café - 5€");
       DisplayMenu(menu, client, MENU_TIME_FOREVER);
    }
    
    public MenuBoisson(client)
    {
       new Handle:menu = CreateMenu(BoissonMenu);
       SetMenuTitle(menu, "Quelle boisson voulez-vous ?");
       AddMenuItem(menu, "redbull", "RedBull - 2€");
       AddMenuItem(menu, "coca", "Coca Cola - 2€");
       AddMenuItem(menu, "tea", "Ice-Tea - 2€");
       DisplayMenu(menu, client, MENU_TIME_FOREVER);
    }
    
    public BouffeMenu(Handle:menu, MenuAction:action, client, param1)
    {
       if(action == MenuAction_Select)
       {
           MenuBoisson(client);
    
           new String:Info[32];
           GetMenuItem(menu, param1, Info, sizeof(Info));
    
           if(StrEqual(Info, "bueno"))
           {
               new hp = GetClientHealth(client);
               new HealthEntity = FindDataMapOffs(client, "m_iHealth");
    
               SetEntData(client, HealthEntity, hp + 1, true);
               SupMoney(client, 2);
           }
           else if(StrEqual(Info, "m&m"))
           {
               new hp = GetClientHealth(client);
               new HealthEntity = FindDataMapOffs(client, "m_iHealth");
    
               SetEntData(client, HealthEntity, hp + 1, true);
               SupMoney(client, 2);
           }
           else if(StrEqual(Info, "maltesers"))
           {
               new hp = GetClientHealth(client);
               new HealthEntity = FindDataMapOffs(client, "m_iHealth");
    
               SetEntData(client, HealthEntity, hp + 2, true);
               SupMoney(client, 4);
           }
           else if(StrEqual(Info, "dragibus"))
           {
               new hp = GetClientHealth(client);
               new HealthEntity = FindDataMapOffs(client, "m_iHealth");
    
               SetEntData(client, HealthEntity, hp + 1, true);
               SupMoney(client, 2);
           }
       }
       else if(action == MenuAction_End)
       {
           CloseHandle(menu);
       }
    }
    
    public CafeMenu(Handle:menu, MenuAction:action, client, param1)
    {
       if(action == MenuAction_Select)
       {
           MenuBoisson(client);
    
           new String:Info[32];
           GetMenuItem(menu, param1, Info, sizeof(Info));
    
           if(StrEqual(Info, "cafe"))
           {
               SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.2);
               SupMoney(client, 5);
    
               h_timerCafe[client] = CreateTimer(10.0, OnCafeEnd, client);
           }
       }
       else if(action == MenuAction_End)
       {
           CloseHandle(menu);
       }
    }
    
    public BoissonMenu(Handle:menu, MenuAction:action, client, param1)
    {
       if(action == MenuAction_Select)
       {
           MenuBoisson(client);
    
           new String:Info[32];
           GetMenuItem(menu, param1, Info, sizeof(Info));
    
           if(StrEqual(Info, "redbull"))
           {
               new hp = GetClientHealth(client);
               new HealthEntity = FindDataMapOffs(client, "m_iHealth");
    
               SetEntData(client, HealthEntity, hp + 1, true);
               SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.1);
               SupMoney(client, 2);
    
               h_timerBoisson[client] = CreateTimer(10.0, OnBoissonEnd, client);
           }
           else if(StrEqual(Info, "coca"))
           {
               new hp = GetClientHealth(client);
               new HealthEntity = FindDataMapOffs(client, "m_iHealth");
    
               SetEntData(client, HealthEntity, hp + 1, true);
               SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.1);
               SupMoney(client, 2);
    
               h_timerBoisson[client] = CreateTimer(10.0, OnBoissonEnd, client);
           }
           else if(StrEqual(Info, "tea"))
           {
               new hp = GetClientHealth(client);
               new HealthEntity = FindDataMapOffs(client, "m_iHealth");
    
               SetEntData(client, HealthEntity, hp + 1, true);
               SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.1);
               SupMoney(client, 2);
    
               h_timerBoisson[client] = CreateTimer(10.0, OnBoissonEnd, client);
           }
       }
       else if(action == MenuAction_End)
       {
           CloseHandle(menu);
       }
    }
    
    public Action:OnCafeEnd(Handle:Timer, any:client)
    {
       SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.0);
    
       KillTimer(h_timerCafe[client]);
       h_timerCafe[client] = INVALID_HANDLE;
    }
    
    public Action:OnBoissonEnd(Handle:Timer, any:client)
    {
       SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.0);
    
       KillTimer(h_timerBoisson[client]);
       h_timerBoisson[client] = INVALID_HANDLE;
    }
    
    IsMachineBouffe(client)
    {    
       new Float:pos[3];
       GetEntPropVector(client, Prop_Send, "m_vecOrigin", pos);
    
       if (pos[0] == -5126.0 && pos[1] == -18.0 && pos[2] == -59.6)
           return true;
       else if (pos[0] == -2370.0 && pos[1] == 1971.0 && pos[2] == -259.6)
           return true;
       else if (pos[0] == -2312.0 && pos[1] == 1971.0 && pos[2] == -259.6)
           return true;
       else if (pos[0] == -888.0 && pos[1] == -1870.0 && pos[2] == -255.6)
           return true;
       else
           return false;
    }
    
    IsMachineCafe(client)
    {    
       new Float:pos[3];
       GetEntPropVector(client, Prop_Send, "m_vecOrigin", pos);
    
       if (pos[0] == -6476.0 && pos[1] == -4879.0 && pos[2] == 70.0)
           return true;
       else
           return false;
    }
    
    IsMachineBoisson(client)
    {    
       new Float:pos[3];
       GetEntPropVector(client, Prop_Send, "m_vecOrigin", pos);
    
       if (pos[0] == -6118.0 && pos[1] == -4454.0 && pos[2] == 64.2)
           return true;
       else if (pos[0] == -4168.0 && pos[1] == -2942.0 && pos[2] == 4032.3)
           return true;
       else if (pos[0] == -4112.0 && pos[1] == -2942.0 && pos[2] == 4032.3)
           return true;
       else if (pos[0] == -4334.0 && pos[1] == -2916.0 && pos[2] == 4072.7)
           return true;
       else if (pos[0] == -3604.0 && pos[1] == 224.0 && pos[2] == 96.2)
           return true;
       else
           return false;
    }

     

    Des que je le compile , j'ai ceci :

     

    //// spawnrp.sp

    // C:\Users\Issam\Desktop\Serveur Blue Games\Role Play\addons\sourcemod\scriptin

    g\spawnrp.sp(89) : error 017: undefined symbol "SupMoney"

    // C:\Users\Issam\Desktop\Serveur Blue Games\Role Play\addons\sourcemod\scriptin

    g\spawnrp.sp(97) : error 017: undefined symbol "SupMoney"

    // C:\Users\Issam\Desktop\Serveur Blue Games\Role Play\addons\sourcemod\scriptin

    g\spawnrp.sp(105) : error 017: undefined symbol "SupMoney"

    // C:\Users\Issam\Desktop\Serveur Blue Games\Role Play\addons\sourcemod\scriptin

    g\spawnrp.sp(113) : error 017: undefined symbol "SupMoney"

    // C:\Users\Issam\Desktop\Serveur Blue Games\Role Play\addons\sourcemod\scriptin

    g\spawnrp.sp(134) : error 017: undefined symbol "SupMoney"

    // C:\Users\Issam\Desktop\Serveur Blue Games\Role Play\addons\sourcemod\scriptin

    g\spawnrp.sp(161) : error 017: undefined symbol "SupMoney"

    // C:\Users\Issam\Desktop\Serveur Blue Games\Role Play\addons\sourcemod\scriptin

    g\spawnrp.sp(172) : error 017: undefined symbol "SupMoney"

    // C:\Users\Issam\Desktop\Serveur Blue Games\Role Play\addons\sourcemod\scriptin

    g\spawnrp.sp(183) : error 017: undefined symbol "SupMoney"

    //

    // 8 Errors.

    //

    // Compilation Time: 0,11 sec

    // ----------------------------------------

     

    Je suis sur CSSRP de Delachambre.

     

    Je voudrais aussi savoir , si quelle qu'un pourrais essayer de faire un Pole emploi , sur la map a coter de l'armurerie , ou était la dame dans le VGRP dans le batiment , bah moi je le voudrais juste devant les portes du batiment :p Merci ,si vous voulais j'ai le code de celui de MGK dans le cssrp.sp

     

    Merci de l'aide ! :)

    Lien vers le commentaire
    Partager sur d’autres sites

    Avec le cssrp la fonction est money[client] -= "le prix"

    mais il ne faut pas que ton plugin sois séparer au cssrp il faut l'inclure dans le cssrp.sp car pour ajouter ou enlever de l'argent il doit être dedans comme la sauvegarde de l'argent n'est pas instantané après achat et si tu veux encore avoir les mise a jour sans avoir a remettre tout le code a chaque fois il faudrai demander à delachambre de le mettre lui même dans le cssrp.sp

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