Jump to content

  •  

Sunzuki

Member Since 29 Apr 2014
Offline Last Active Jul 03 2014 01:49 AM
-----

Posts I've Made

In Topic: query_sql to Array

01 July 2014 - 12:02 AM

You could use sql command: "[color=rgb(221,0,0);font-family:'Fira Mono', 'Source Code Pro', monospace;]SHOW COLUMNS FROM sometable"[/color]


In Topic: query_sql to Array

30 June 2014 - 11:16 PM

no it wouldn't. if it would work it would be

.@tempvar$[0] = 1

.@tempvar$[1] = 2

you have to add more variables to the end.

 

query_sql[color=rgb(102,102,0);]([/color][color=rgb(0,136,0);]"SELECT * FROM `awesome_table` WHERE `ID`=1"[/color][color=rgb(102,102,0);], .[/color][color=rgb(0,102,102);]@ID, [/color][color=rgb(102,102,0);].[/color][color=rgb(0,102,102);]@[/color]Name[color=#ff0000]$[/color], .@val1, .@val2, .@val3[color=rgb(102,102,0);]);[/color]

.@ID[0] = 1; [color=rgb(102,102,0);].[/color][color=rgb(0,102,102);]@[/color]Name$[0] = Hi

.@ID[1] = 2; [color=rgb(102,102,0);].[/color][color=rgb(0,102,102);]@[/color]Name$[0] = Hello

 

basically you just put the columns (from after select, * = all) in the second part of the query_sql command

 

$ because it is a string not an integer


In Topic: sql and txt

30 June 2014 - 06:01 AM

and @ii and all still works?


In Topic: Foul Language Detected problem

26 June 2014 - 06:02 PM

I don't know for sure but try to remove 'ass' from data/manner.txt


In Topic: @monster that spawns random location

23 June 2014 - 05:01 PM

-	script	OnInit	-1,{end;OnInit:	bindatcmd "monster2", "AtCommands::OnMonster2", <GM Level>, 99;end;}-	script	AtCommands	-1,{end;OnMonster2:	if(getarraysize(.@atcmd_parameters$) == 1) {		set .@mobid,.@atcmd_parameters$[0];		monster ""+strcharinfo(3)+"",0,0,""+strmobinfo(1, .@mobid)+"",.@mobid,1;	} else if(getarraysize(.@atcmd_parameters$) == 2) {		set .@mobid,.@atcmd_parameters$[0];		set .@map$,.@atcmd_parameters$[1];		monster ""+.@map$+"",0,0,""+strmobinfo(1, .@mobid)+"",.@mobid,1;	} else if(getarraysize(.@atcmd_parameters$) == 3) {		set .@mobid,.@atcmd_parameters$[0];		set .@amount,.@atcmd_parameters$[1];		if(!.@amount) set .@amount,1;		set .@map$,.@atcmd_parameters$[2];		monster ""+.@map$+"",0,0,""+strmobinfo(1, .@mobid)+"",.@mobid,.@amount;	} else {		message strcharinfo(0), "Wrong command format. Possible formats:";		message strcharinfo(0), " - @monster2 <Mob ID> <amount> <map>";		message strcharinfo(0), " - @monster2 <Mob ID> <map>";		message strcharinfo(0), " - @monster2 <Mob ID>";		message strcharinfo(0), "@monster2 failed.";	}end;} 

 

 [color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]It could basically work like that, but I'm not good of a coder and I don't know how to check if a monster ID or a map is valid. There will be a console message when someone enters invalid values I assume. Don't forget to change gm level if you use it[/color]