AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Basic_info help (https://forums.alliedmods.net/showthread.php?t=127475)

VanLi_bRuSly* 05-21-2010 15:06

Basic_info help
 
how much more I can do
Quote:

"gwalt",
"narkotyki",
"zabojstwo",
"alkohol",
"molestowanie",
"pobicie babci",
"napad na monopolowy",
"dziesione"
alternative?


Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN "Jail Break: Basic Info"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"

#define USERTASK 921
#define UPDATEDELAY 1.0

new static reasons[][] = {
    "gwalt",
    "narkotyki",
    "zabojstwo",
    "alkohol",
    "molestowanie",
    "pobicie babci",
    "napad na monopolowy",
    "dziesione"
}

new userreason[33]
new rounds, hudhandler

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)   
   
    register_event("TextMsg","restart_roundsnum","a","2&#Game_C"/*,"2&#Game_w"*/)
   
    register_logevent("round_end", 2, "1=Round_End") 
   
    RegisterHam(Ham_Spawn, "player", "client_spawn", 1)   
   
    hudhandler = CreateHudSyncObj()
}

public round_end()
{
    rounds ++
}

public restart_roundsnum()
{
    rounds = 0
}

public client_disconnect(id)
{
    userreason[id] = -1
   
    if(task_exists(id + USERTASK))
    {
        remove_task(id + USERTASK)
    }
}

public client_spawn(id)
{   
    if(task_exists(id + USERTASK))
    {
        remove_task(id + USERTASK)
    }   
   
    if(get_user_team(id) == 1)
    {   
        userreason[id] = random_num(0, sizeof reasons - 1)
       
        set_task(UPDATEDELAY, "client_jailinfo", id + USERTASK, _, _, "b")
    }   
}

public client_jailinfo(TASKID)
{
    static id
    id = TASKID - USERTASK
   
    set_hudmessage(0, 255, 0, 0.8, 0.1, 0, 6.0, 12.0)
   
    ShowSyncHudMsg(id, hudhandler, "Dzien %d | Siedzisz za %s.", rounds, reasons[userreason[id]])   
}


Brreaker 05-21-2010 15:27

Re: Basic_info help
 
I don't really understand what you are trying to do, can you please be more accurate?

VanLi_bRuSly* 05-21-2010 15:45

Re: Basic_info help
 
have to go to jail because I want them to reproduce

unnyquee 05-21-2010 16:06

Re: Basic_info help
 
You can type as much reasons as you want :)

VanLi_bRuSly* 05-21-2010 16:32

Re: Basic_info help
 
Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN "Jail Break: Basic Info"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"

#define USERTASK 921
#define UPDATEDELAY 1.0

new static reasons[][] = {
    "gwalt",
    "narkotyki",
    "zabojstwo",
    "alkohol",
    "molestowanie",
    "pobicie babci",
    "napad na monopolowy",
    "dziesione"
    "wwwww",
    "yyyyy",
    "xxxxx",
}

new userreason[33]
new rounds, hudhandler

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)   
   
    register_event("TextMsg","restart_roundsnum","a","2&#Game_C"/*,"2&#Game_w"*/)
   
    register_logevent("round_end", 2, "1=Round_End") 
   
    RegisterHam(Ham_Spawn, "player", "client_spawn", 1)   
   
    hudhandler = CreateHudSyncObj()
}

public round_end()
{
    rounds ++
}

public restart_roundsnum()
{
    rounds = 0
}

public client_disconnect(id)
{
    userreason[id] = -1
   
    if(task_exists(id + USERTASK))
    {
        remove_task(id + USERTASK)
    }
}

public client_spawn(id)
{   
    if(task_exists(id + USERTASK))
    {
        remove_task(id + USERTASK)
    }   
   
    if(get_user_team(id) == 1)
    {   
        userreason[id] = random_num(0, sizeof reasons - 1)
       
        set_task(UPDATEDELAY, "client_jailinfo", id + USERTASK, _, _, "b")
    }   
}

public client_jailinfo(TASKID)
{
    static id
    id = TASKID - USERTASK
   
    set_hudmessage(0, 255, 0, 0.8, 0.1, 0, 6.0, 12.0)
   
    ShowSyncHudMsg(id, hudhandler, "Dzien %d | Siedzisz za %s.", rounds, reasons[userreason[id]])   
}


such error happens when I add them.

Where am I doing incorrect?

Brreaker 05-21-2010 16:33

Re: Basic_info help
 
Post the error...

Alka 05-21-2010 16:38

Re: Basic_info help
 
At the end of array "reasons", last entry, in your case "xxxxx", should not have comma after it.

PHP Code:

new static reasons[][] = { 
    
"gwalt",
    
"narkotyki",
    
"zabojstwo",
    
"alkohol",
    
"molestowanie",
    
"pobicie babci",
    
"napad na monopolowy",
    
"dziesione",
    
"wwwww",
    
"yyyyy",
    
"xxxxx"


And all before last entry should have a comma.

fysiks 05-21-2010 16:38

Re: Basic_info help
 
:arrow:

Code:

"dziesione",

VanLi_bRuSly* 05-22-2010 03:02

Re: Basic_info help
 
Quote:

Originally Posted by Alka (Post 1187152)
At the end of array "reasons", last entry, in your case "xxxxx", should not have comma after it.

PHP Code:

new static reasons[][] = { 
    
"gwalt",
    
"narkotyki",
    
"zabojstwo",
    
"alkohol",
    
"molestowanie",
    
"pobicie babci",
    
"napad na monopolowy",
    
"dziesione",
    
"wwwww",
    
"yyyyy",
    
"xxxxx"


And all before last entry should have a comma.


Thank you


All times are GMT -4. The time now is 03:37.

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