Raised This Month: $12 Target: $400
 3% 

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


  
 
 
Thread Tools Display Modes
Author Message
Zack771
Senior Member
Join Date: Apr 2012
Location: 192.168.1.16
Old 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
Zack771 is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 09-19-2012 , 11:31   Re: Problème ajout de vérification d'un flag admin
#2

AlliedModders Forum Index > AMX Mod X > Multilingual > French
__________________
You can do anything you set your mind to, man.

Devil259 is offline
Zack771
Senior Member
Join Date: Apr 2012
Location: 192.168.1.16
Old 09-19-2012 , 11:35   Re: Problème ajout de vérification d'un flag admin
#3

Ah oui tromper de section désolé...
Un admin peux déplacer mon topic ici svp :https://forums.alliedmods.net/forumdisplay.php?f=107 ?
__________________
"Embrace your dreams, and whatever happend protect your honor"
Zack Fair
Zack771 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-19-2012 , 11:51   Re: Problème ajout de vérification d'un flag admin
#4

Non, c'est une section anglaise, il va donc falloir parler anglais.

Bon courage.
__________________
Arkshine is offline
Zack771
Senior Member
Join Date: Apr 2012
Location: 192.168.1.16
Old 09-19-2012 , 12:40   Re: Problème ajout de vérification d'un flag admin
#5

Ok d'accord, pas de problème pour l'anglais je gère
__________________
"Embrace your dreams, and whatever happend protect your honor"
Zack Fair
Zack771 is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:30.


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