December 05, 2023, 04:04:34 pm

The Gang Garrison 2 Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

NOTICE: Due to a rise in bot activity, new posters need to be approved before posting.

Join the community Discord server!

Pages: 1 2 [3] 4

Author Topic: -  (Read 6848 times)

boynedmaster

  • New Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 31
Re: Arctic's chatv5 extended
« Reply #30 on: April 20, 2014, 04:35:53 pm »

errr, oops

here

Code: [Select]
if !variable_global_exists("<commandMap> or <clientCommandMap>") {global.<commandMap> or <clientCommandMap> = ds_map_create();}

ds_map_add(global.<commandMap> or <clientCommandMap>,"COMMAND NAME","
    CODE
");

didn't work for me
here's my code now
Code: [Select]
if(!variable_global_exists("clientCommandMap")){
global.clientCommandMap = ds_map_create();
}

if(!variable_global_exists("helpMap")){
global.helpMap = ds_map_create();
}
ds_map_add(global.clientCommandMap,"dicks","
    playerId = 255;
    _team = 0;
    if(global.isHost) {
        messageToBroadcast = ds_list_find_value(argument0,1);
        _message = 'O[CONSOLE] '+string(messageToBroadcast);
        _message = string_replace_all(_message,'#',' ');
        event_user(2);
        event_user(4);
    }
    else if(global.isHost)
    {
        _message = 'OThis command can only be executed by the host.';
        event_user(4);
    }
");
ds_map_add(global.helpMap,"dicks","Sends a broadcast message");
Logged
emolga is cute as fuck

notarctic

  • just arctic, what gives?
  • ******
  • Karma: 8
  • Offline Offline
  • Posts: 4904
  • 👎👀 bad aim ba̷̶ ԁ aIm 👎 thats❌ some bad 👎👎aim
    • arcticland
Re: Arctic's chatv5 extended
« Reply #31 on: April 20, 2014, 04:57:14 pm »

huh? that should work though
Logged
[1:37:51 PM] Derpduck: arctic u need to quote ppl that make shit posts in case they edit them
[4:20:15 PM] Rubeus Hashgrid: i cant discover anything fuck you imageshack

boynedmaster

  • New Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 31
Re: Arctic's chatv5 extended
« Reply #32 on: April 20, 2014, 06:39:59 pm »

huh? that should work though
Yeah, I don't know why it doesn't. So in the next update can you use AJF's Console API? It'd be amazing.
Logged
emolga is cute as fuck

ajf

  • (Ex-?)Developer and forum/web admin
  • *****
  • Karma: 7
  • Offline Offline
  • Posts: 3494
  • she's never quite as dead as you think
Re: Arctic's chatv5 extended
« Reply #33 on: April 20, 2014, 07:13:50 pm »

huh? that should work though
Yeah, I don't know why it doesn't. So in the next update can you use AJF's Console API? It'd be amazing.
It would be impossible for arctic to implement it since plugins can't define functions, sadly.

I suppose he could make a set of scripts you could use with execute_string, though.
Logged
did you know that spinning stars work like this???

I've seen things you people wouldn't believe. execute_strings on fire off the shoulder of Overmars. I watched object-beams glitter in the dark near the room_goto_fix. All those moments will be lost in time, like tears...in...rain. Time to die.

boynedmaster

  • New Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 31
Re: Arctic's chatv5 extended
« Reply #34 on: April 20, 2014, 07:36:15 pm »

huh? that should work though
Yeah, I don't know why it doesn't. So in the next update can you use AJF's Console API? It'd be amazing.
It would be impossible for arctic to implement it since plugins can't define functions, sadly.

I suppose he could make a set of scripts you could use with execute_string, though.
Yeah that'd be awesome if he could.
Logged
emolga is cute as fuck

boynedmaster

  • New Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 31
Re: Arctic's chatv5 extended
« Reply #35 on: May 05, 2014, 09:43:40 pm »

aight so i made a few fixes and now it works:
Code: [Select]
object_event_add(SpawnPointRed, ev_create, 0, '
if(!variable_global_exists("clientCommandMap")){
global.clientCommandMap = ds_map_create();
}

if(!variable_global_exists("helpMap")){
global.helpMap = ds_map_create();
}

ds_map_add(global.clientCommandMap,"dicks","
    playerId = 255;
    _team = 0;
    if(global.isHost) {
        messageToBroadcast = ds_list_find_value(argument0,1);
        _message = '+"'O[CONSOLE] '+string(messageToBroadcast);
        _message = string_replace_all(_message,'#',' ');
        event_user(2);
        event_user(4);
    }
    else if(global.isHost)
    {
        _message = 'OThis command can only be executed by the host.';
        event_user(4);
    }
"+'");
ds_map_add(global.helpMap,"dicks","Sends a broadcast message");
');
only problem
when you type /help
you get this error
Code: [Select]

___________________________________________
ERROR in
action number 1
of Other Event: User Defined 9
for object __newobject834:

Error in code at line 10:
               _message += ', '+previous;
                               ^
at position 30: Wrong type of arguments to +.

edit:
i added this code and it seems to fix it for the time
only problem
now /help is disabled
Code: [Select]
if(ds_map_exists(global.clientCommandMap, "help")){
ds_map_delete(global.clientCommandMap, "help");
}

if(ds_map_exists(global.commandMap, "help")){
ds_map_delete(global.commandMap, "help");
}
ds_map_add(global.clientCommandMap,"help","
 _message = '+"'ODisabled because other plugins break with this on.'"+';
    playerId = 255;
    _team = 0;
    target = _player;
    if target != global.myself event_user(2);
    else event_user(4);
");

ds_map_add(global.commandMap,"help","
 _message = '+"'ODisabled because other plugins break with this on.'"+';
    playerId = 255;
    _team = 0;
    target = _player;
    if target != global.myself event_user(2);
    else event_user(4);
");

ds_map_add(global.helpMap,"help","Disabled (this is here just in case it fixes)");
« Last Edit: May 05, 2014, 09:52:34 pm by boynedmaster »
Logged
emolga is cute as fuck

notarctic

  • just arctic, what gives?
  • ******
  • Karma: 8
  • Offline Offline
  • Posts: 4904
  • 👎👀 bad aim ba̷̶ ԁ aIm 👎 thats❌ some bad 👎👎aim
    • arcticland
Re: Arctic's chatv5 extended
« Reply #36 on: May 05, 2014, 10:20:42 pm »

ok

Code: [Select]
if !variable_global_exists("clientComandMap") {global.clientCommandMap = ds_map_create();}
if !variable_global_exists("helpMap") {global.helpMap = ds_map_create();}
ds_map_add(global.clientCommandMap,"sayhi","
    //code to execute
    playerId = 255;
    _team = 0;
    _message = 'OHELLO WORLD';
    event_user(2);
    event_user(4);
");
ds_map_add(global.clientCommandMap,"add","
    //you do command arguments like this
    //variable1 = ds_list_find_value(argument0,1);
    //variable2 = ds_list_find_value(argument0,2);
    //variable3 = ds_list_find_value(argument0,3);
    add1 = ds_list_find_value(argument0,1);
    add2 = ds_list_find_value(argument0,2);
    _message = 'O'+string(add1+add2);
    event_user(4);
");
ds_map_add(global.helpMap,"add","Adds 2 numbers Usage /add 1 + 2");
ds_map_add(global.helpMap,"sayhi","Says hello world");

very very very basic and easy to understand, try it and see if it works
Logged
[1:37:51 PM] Derpduck: arctic u need to quote ppl that make shit posts in case they edit them
[4:20:15 PM] Rubeus Hashgrid: i cant discover anything fuck you imageshack

boynedmaster

  • New Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 31
Re: Arctic's chatv5 extended
« Reply #37 on: May 06, 2014, 05:42:15 pm »

ok

Code: [Select]
if !variable_global_exists("clientComandMap") {global.clientCommandMap = ds_map_create();}
if !variable_global_exists("helpMap") {global.helpMap = ds_map_create();}
ds_map_add(global.clientCommandMap,"sayhi","
    //code to execute
    playerId = 255;
    _team = 0;
    _message = 'OHELLO WORLD';
    event_user(2);
    event_user(4);
");
ds_map_add(global.clientCommandMap,"add","
    //you do command arguments like this
    //variable1 = ds_list_find_value(argument0,1);
    //variable2 = ds_list_find_value(argument0,2);
    //variable3 = ds_list_find_value(argument0,3);
    add1 = ds_list_find_value(argument0,1);
    add2 = ds_list_find_value(argument0,2);
    _message = 'O'+string(add1+add2);
    event_user(4);
");
ds_map_add(global.helpMap,"add","Adds 2 numbers Usage /add 1 + 2");
ds_map_add(global.helpMap,"sayhi","Says hello world");

very very very basic and easy to understand, try it and see if it works
didnt we go over this
and it didnt work
Logged
emolga is cute as fuck

notarctic

  • just arctic, what gives?
  • ******
  • Karma: 8
  • Offline Offline
  • Posts: 4904
  • 👎👀 bad aim ba̷̶ ԁ aIm 👎 thats❌ some bad 👎👎aim
    • arcticland
Re: Arctic's chatv5 extended
« Reply #38 on: May 06, 2014, 09:07:51 pm »

ok...i have no idea why it dosn't work when I add to client command map, but add to commandMap (the server command map) and it should work fine (assuming you are the host)
Logged
[1:37:51 PM] Derpduck: arctic u need to quote ppl that make shit posts in case they edit them
[4:20:15 PM] Rubeus Hashgrid: i cant discover anything fuck you imageshack

boynedmaster

  • New Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 31
Re: Arctic's chatv5 extended
« Reply #39 on: May 06, 2014, 09:58:04 pm »

ok...i have no idea why it dosn't work when I add to client command map, but add to commandMap (the server command map) and it should work fine (assuming you are the host)
tried it
doesnt work
jesus christ
Logged
emolga is cute as fuck

notarctic

  • just arctic, what gives?
  • ******
  • Karma: 8
  • Offline Offline
  • Posts: 4904
  • 👎👀 bad aim ba̷̶ ԁ aIm 👎 thats❌ some bad 👎👎aim
    • arcticland
Re: Arctic's chatv5 extended
« Reply #40 on: May 06, 2014, 10:20:02 pm »

it worked for me, besides what do you need this so badly for? I really don't feel like being bothered about this
Logged
[1:37:51 PM] Derpduck: arctic u need to quote ppl that make shit posts in case they edit them
[4:20:15 PM] Rubeus Hashgrid: i cant discover anything fuck you imageshack

Bluez

  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 411
Re: Arctic's chatv5 extended
« Reply #41 on: May 07, 2014, 04:36:26 pm »

Code: [Select]
___________________________________________
ERROR in
action number 1
of Other Event: User Defined 9
for object __newobject844:

Error in code at line 9:
       } else if global.isHost or _player.isRcon == true {
                                         ^
at position 40: Unknown variable isRcon

i get this error when i try to use /nextround. is this error fixable?
« Last Edit: May 07, 2014, 04:36:55 pm by Bluez »
Logged

boynedmaster

  • New Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 31
Re: Arctic's chatv5 extended
« Reply #42 on: May 07, 2014, 05:12:57 pm »

it worked for me, besides what do you need this so badly for? I really don't feel like being bothered about this
just for custom commands
im just gonna disable help until i find a better way
Logged
emolga is cute as fuck

notarctic

  • just arctic, what gives?
  • ******
  • Karma: 8
  • Offline Offline
  • Posts: 4904
  • 👎👀 bad aim ba̷̶ ԁ aIm 👎 thats❌ some bad 👎👎aim
    • arcticland
Re: Arctic's chatv5 extended
« Reply #43 on: May 07, 2014, 05:23:47 pm »

Code: [Select]
___________________________________________
ERROR in
action number 1
of Other Event: User Defined 9
for object __newobject844:

Error in code at line 9:
       } else if global.isHost or _player.isRcon == true {
                                         ^
at position 40: Unknown variable isRcon

i get this error when i try to use /nextround. is this error fixable?
OOPS, sorry, left in some prototype rcon code
Logged
[1:37:51 PM] Derpduck: arctic u need to quote ppl that make shit posts in case they edit them
[4:20:15 PM] Rubeus Hashgrid: i cant discover anything fuck you imageshack

ZaSpai

  • Ray Bann's Minion
  • *
  • Karma: 14
  • Offline Offline
  • Posts: 2239
  • "Eeh?! We're just allies!"
Re: Arctic's chatv5 extended
« Reply #44 on: May 10, 2014, 04:33:24 am »

Code: [Select]
global.totalQuotes = 13
global.quoteGen[0]=('75% of stair accidents happen on stairs!');
global.quoteGen[1]=('How do you know a Black used your computer?');
global.quoteGen[2]=("That's what.* -She");
global.quoteGen[3]=('I miss my umbilical cord. I grew up attached to it.');
global.quoteGen[4]=('Sperm jokes come in unexpected.');
global.quoteGen[5]=("The buggy draw event actually isn't arctic's fault");
global.quoteGen[7]=("Not widescreen tested");
global.quoteGen[8]=("Help, I'm stuck in a randomly-generated quote factory!");
global.quoteGen[9]=("Worth more than miku");
global.quoteGen[10]=("Don't have a event clearing fetish");
global.quoteGen[11]=("I play nice with DSM");
global.quoteGen[12]=("there was a medic going z6");
global.quoteGen[13]=("I made cookies");

no number 6? :P

Logged
Right behind you when you most expect it | classicwell master race
Pages: 1 2 [3] 4
 

Page created in 0.041 seconds with 36 queries.