AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   French (https://forums.alliedmods.net/forumdisplay.php?f=20)
-   -   Problème ajout de vérification d'un flag admin (https://forums.alliedmods.net/showthread.php?t=196350)

Zack771 09-19-2012 08:34

Problème ajout de vérification d'un flag admin
 
Bonjour,

Script de base :
Code:

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

#pragma semicolon 1

#define FragColor        {225,0,0,225}
#define FlashColor        {225,225,225,225}
#define SmokeColor        {0,225,0,225}

new BeamSprite;
new Handle:GTrailsEnabled;

public Plugin:myinfo =
{
        name = "Grenade Trails",
        author = "Fredd",
        description = "Adds a trail to grenades.",
        version = "1.1",
        url = "www.sourcemod.net"
}
public OnMapStart()
{
        BeamSprite = PrecacheModel("materials/sprites/crystal_beam1.vmt");
}
public OnPluginStart()
{
        CreateConVar("gt_version", "1.1", "Grenade Trails Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
       
        GTrailsEnabled                = CreateConVar("gt_enables",        "1",                "Enables/Disables Grenade Trails");       
}
public OnEntityCreated(Entity, const String:Classname[])
{
        if(GetConVarInt(GTrailsEnabled) != 1)
                return;
       
        if(strcmp(Classname, "hegrenade_projectile") == 0)
        {
                TE_SetupBeamFollow(Entity, BeamSprite,        0, Float:1.0, Float:10.0, Float:10.0, 5, FragColor);
                TE_SendToAll();
               
        } else if(strcmp(Classname, "flashbang_projectile") == 0)
        {
                TE_SetupBeamFollow(Entity, BeamSprite,        0, Float:1.0, Float:10.0, Float:10.0, 5, FlashColor);
                TE_SendToAll();
        } else if(strcmp(Classname, "smokegrenade_projectile") == 0)
        {
                TE_SetupBeamFollow(Entity, BeamSprite,        0, Float:1.0, Float:10.0, Float:10.0, 5, SmokeColor);
                TE_SendToAll();       
        }
        return;
}

J'ai voulu rajouter a ce script la vérification de la possession du flag q (ADMFLAG_CUSTOM3) par le client. Voici donc le script modifier :

Code:

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

#pragma semicolon 1

#define FragColor        {225,0,0,225}
#define FlashColor        {225,225,225,225}
#define SmokeColor        {0,225,0,225}

new BeamSprite;
new Handle:GTrailsEnabled;

public Plugin:myinfo =
{
        name = "Grenade Trails",
        author = "Fredd",
        description = "Adds a trail to grenades.",
        version = "1.1",
        url = "www.sourcemod.net"
}       
public OnMapStart()
{
        BeamSprite = PrecacheModel("materials/sprites/crystal_beam1.vmt");
}
public OnPluginStart()
{
        CreateConVar("gt_version", "1.1", "Grenade Trails Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
       
        GTrailsEnabled = CreateConVar("gt_enables",        "1",                "Enables/Disables Grenade Trails");       
}
public OnEntityCreated(Entity, const String:Classname[])
{
        if(GetConVarInt(GTrailsEnabled) != 1)
                return;
               
        if(GetUserFlagBits(client) & ADMFLAG_CUSTOM3)
        {
                if(strcmp(Classname, "hegrenade_projectile") == 0)
                {
                        TE_SetupBeamFollow(Entity, BeamSprite,        0, Float:1.0, Float:10.0, Float:10.0, 5, FragColor);
                        TE_SendToClient(client);
                }
                else if(strcmp(Classname, "flashbang_projectile") == 0)
                {
                        TE_SetupBeamFollow(Entity, BeamSprite,        0, Float:1.0, Float:10.0, Float:10.0, 5, FlashColor);
                        TE_SendToClient(client);
                }
                else if(strcmp(Classname, "smokegrenade_projectile") == 0)
                {
                        TE_SetupBeamFollow(Entity, BeamSprite,        0, Float:1.0, Float:10.0, Float:10.0, 5, SmokeColor);
                        TE_SendToClient(client);       
                }
                return;
        }
}

Cependant pendant la compile j'ai les erreurs suivantes :

Quote:

Ligne 37 : error 017: undefined symbol "client"
Ligne 42 : error 017: undefined symbol "client"
Ligne 47 : error 017: undefined symbol "client"
Ligne 52 : error 017: undefined symbol "client"

Ligne 37 : if(GetUserFlagBits(client) & ADMFLAG_CUSTOM3)
Ligne 42 : TE_SendToClient(client);
Ligne 47 : TE_SendToClient(client);
Ligne 52 : TE_SendToClient(client);
Comment cela se fait-il ? Comment régler sa svp ?

Devil259 09-19-2012 11:31

Re: Problème ajout de vérification d'un flag admin
 
AlliedModders Forum Index > AMX Mod X > Multilingual > French

Zack771 09-19-2012 11:35

Re: Problème ajout de vérification d'un flag admin
 
Ah oui tromper de section désolé...
Un admin peux déplacer mon topic ici svp :https://forums.alliedmods.net/forumdisplay.php?f=107 ?

Arkshine 09-19-2012 11:51

Re: Problème ajout de vérification d'un flag admin
 
Non, c'est une section anglaise, il va donc falloir parler anglais.

Bon courage.

Zack771 09-19-2012 12:40

Re: Problème ajout de vérification d'un flag admin
 
Ok d'accord, pas de problème pour l'anglais je gère :)


All times are GMT -4. The time now is 01:07.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.