Senior Member
Join Date: Apr 2012
Location: 192.168.1.16
|
09-19-2012
, 08:34
Problème ajout de vérification d'un flag admin
|
#1
|
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 ?
__________________
"Embrace your dreams, and whatever happend protect your honor"
Zack Fair
|
|