AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   HELP::..::edit script (https://forums.alliedmods.net/showthread.php?t=271637)

Big Noob 09-16-2015 15:07

HELP::..::edit script
 
hy

this (ACG XPHERE) plugin draw two picture in TGA format. ct.tga for CT team and tt.tga for T team
but the plugin shows only one picture for both teams

How edit the scripte to solve this problem?

PHP Code:

#include <amxmodx>
#include <acg>
public plugin_init() {
 
register_plugin("TGA Drawing Test""0.2""[email protected]")
}
public 
plugin_precache()

 
precache_generic("gfx/tt.tga")
 
precache_generic("gfx/ct.tga")
}
public 
client_putinserver(id)
{
 if (
acg_userstatus(id))
 {
  
set_task(3.0,"showtga",id)
 }
}
public 
showtga(id)
{
 
//native acg_drawtga(id, const szTGA[], red, green, blue, alpha, Float:x, Float:y, center, effects, Float:fadeintime, Float:fadeouttime, Float:fxtime, Float:holdtime, bfullscreen, align, channel)
        
acg_drawtga(id"gfx/tt.tga"2552552552000.00.00FX_FADE3.00.00.0, -10ALIGN_RIGHT2
 
acg_drawtga(id"gfx/ct.tga"2552552552000.00.00FX_FADE3.00.00.0, -10ALIGN_RIGHT2)



redivcram 09-17-2015 06:35

Re: HELP::..::edit script
 
PHP Code:

#include <amxmodx>
#include <cstrike>
#include <acg>

public plugin_init()
{
    
register_plugin("TGA Drawing Test""0.2""[email protected]")
}

public 
plugin_precache()

    
precache_generic("gfx/tt.tga")
    
precache_generic("gfx/ct.tga")
}

public 
client_putinserver(id)
{
    if (
acg_userstatus(id))
    {
    
set_task(3.0,"showtga",id)
    }
}

public 
showtga(id)
{
    
//native acg_drawtga(id, const szTGA[], red, green, blue, alpha, Float:x, Float:y, center, effects, Float:fadeintime, Float:fadeouttime, Float:fxtime, Float:holdtime, bfullscreen, align, channel)
    
if(cs_get_user_team(id) == CS_TEAM_T)
    {
        
acg_drawtga(id"gfx/tt.tga"2552552552000.00.00FX_FADE3.00.00.0, -10ALIGN_RIGHT2)
    }
    else if(
cs_get_user_team(id) == CS_TEAM_CT)
    {
        
acg_drawtga(id"gfx/ct.tga"2552552552000.00.00FX_FADE3.00.00.0, -10ALIGN_RIGHT2)
    }
    return 
PLUGIN_HANDLED


Simple as that

Big Noob 09-17-2015 08:04

Re: HELP::..::edit script
 
it's working now. thank friend:up:

but with little bug ...if you login into the server as CT team you get CT team PICTURE.
and if you change to T team inside the server the picture not changing
you must login first as ct or t to get the right pictures

[QUOTE=redivcram;2343840]
PHP Code:

#include <amxmodx>
#include <cstrike>
#include <acg>

public plugin_init()
{
    
register_plugin("TGA Drawing Test""0.2""[email protected]")
}

public 
plugin_precache()

    
precache_generic("gfx/tt.tga")
    
precache_generic("gfx/ct.tga")
}

public 
client_putinserver(id)
{
    if (
acg_userstatus(id))
    {
    
set_task(3.0,"showtga",id)
    }
}

public 
showtga(id)
{
    
//native acg_drawtga(id, const szTGA[], red, green, blue, alpha, Float:x, Float:y, center, effects, Float:fadeintime, Float:fadeouttime, Float:fxtime, Float:holdtime, bfullscreen, align, channel)
    
if(cs_get_user_team(id) == CS_TEAM_T)
    {
        
acg_drawtga(id"gfx/tt.tga"2552552552000.00.00FX_FADE3.00.00.0, -10ALIGN_RIGHT2)
    }
    else if(
cs_get_user_team(id) == CS_TEAM_CT)
    {
        
acg_drawtga(id"gfx/ct.tga"2552552552000.00.00FX_FADE3.00.00.0, -10ALIGN_RIGHT2)
    }
    return 
PLUGIN_HANDLED



redivcram 09-17-2015 19:16

Re: HELP::..::edit script
 
Hmmm

Try this..

UPDATED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!

PHP Code:

#include <amxmodx>
#include <cstrike>
#include <acg>

#define TASK_TGA1 29387
#define TASK_TGA2 42837

public plugin_init()
{
    
register_plugin("TGA Drawing Test""0.2""[email protected]")
}

public 
plugin_precache()

    
precache_generic("gfx/tt.tga")
    
precache_generic("gfx/ct.tga")
}

public 
client_disconnect(id)
{
    
remove_task(id+TASK_TGA1)
    
remove_task(id+TASK_TGA2)
}

public 
client_putinserver(id)
{
    if (
acg_userstatus(id))
    {
        
set_task(3.0,"showtga1",id+TASK_TGA1)
    }
}

public 
client_infochanged(id)
{
    if(
acg_userstatus(id))
    {
        
remove_task(id+TASK_TGA1)
        
set_task(3.0,"showtga2",id+TASK_TGA2)
    }
}

public 
showtga1(id)
{
    
id -= TASK_TGA1
    
    
//native acg_drawtga(id, const szTGA[], red, green, blue, alpha, Float:x, Float:y, center, effects, Float:fadeintime, Float:fadeouttime, Float:fxtime, Float:holdtime, bfullscreen, align, channel)
    
if(cs_get_user_team(id) == CS_TEAM_T)
    {
        
acg_drawtga(id"gfx/tt.tga"2552552552000.00.00FX_FADE3.00.00.0, -10ALIGN_RIGHT2)
    }
    else if(
cs_get_user_team(id) == CS_TEAM_CT)
    {
        
acg_drawtga(id"gfx/ct.tga"2552552552000.00.00FX_FADE3.00.00.0, -10ALIGN_RIGHT2)
    }
    return 
PLUGIN_HANDLED


public 
showtga2(id)
{
    
id -= TASK_TGA2
    
    
//native acg_drawtga(id, const szTGA[], red, green, blue, alpha, Float:x, Float:y, center, effects, Float:fadeintime, Float:fadeouttime, Float:fxtime, Float:holdtime, bfullscreen, align, channel)
    
if(cs_get_user_team(id) == CS_TEAM_T)
    {
        
acg_drawtga(id"gfx/tt.tga"2552552552000.00.00FX_FADE3.00.00.0, -10ALIGN_RIGHT2)
    }
    else if(
cs_get_user_team(id) == CS_TEAM_CT)
    {
        
acg_drawtga(id"gfx/ct.tga"2552552552000.00.00FX_FADE3.00.00.0, -10ALIGN_RIGHT2)
    }
    return 
PLUGIN_HANDLED


Not sure about it though

Big Noob 09-17-2015 20:54

Re: HELP::..::edit script
 
not work at all ... not showing any pictures:shock:

redivcram 09-18-2015 07:56

Re: HELP::..::edit script
 
Updated code above

Big Noob 09-18-2015 10:09

Re: HELP::..::edit script
 
Quote:

Originally Posted by redivcram (Post 2344239)
Updated code above

yes my friend ... awesome

plugin works perfectly. and i am Big Noob . .. I give you Great BIG Thank You:up:

redivcram 09-18-2015 10:58

Re: HELP::..::edit script
 
You're welcome


All times are GMT -4. The time now is 22:11.

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