pajodex Posted January 30, 2018 Group: Members Topic Count: 79 Topics Per Day: 0.03 Content Count: 439 Reputation: 173 Joined: 12/12/17 Last Seen: April 14 Share Posted January 30, 2018 Hi, I'm getting console error: [Error]: buildin_getcharid: Player with nick '150103' is not found. [Error]: buildin_getcharid: Player with nick '150103' is not found. with this code: OnClock0000: set .prize, 7227; set .amount, 5; query_sql "SELECT `char_id` FROM `char_reg_num` ORDER BY `key` = 'kills' DESC LIMIT 1",$kill$; set if (!isloggedin(getcharid(0, $kill$))) { query_sql "INSERT INTO `inventory` (`char_id`, `nameid`, `amount`, `equip`, `identify` ) VALUES ('" +getcharid(0, $kill$)+ "', '" +.prize+ "', '" +.amount+ "', 0, 1)"; } else getitem .prize, .amount, getcharid(0, $kill$); end; I based it from this post xD Regards~ Quote Link to comment Share on other sites More sharing options...
0 Sindit Posted January 31, 2018 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 22 Reputation: 11 Joined: 07/16/17 Last Seen: March 25, 2018 Share Posted January 31, 2018 (edited) Instead of use getcharid(0, $kill$), you just need to use $kill$ ($kill$ is actually saving the character id (char_id) and not the character name (name), so you don't need to use getcharid). Try this: OnClock0000: set .prize, 7227; set .amount, 5; query_sql "SELECT `char_id` FROM `char_reg_num` ORDER BY `key` = 'kills' DESC LIMIT 1", $kill$; query_sql "SELECT `name` FROM `char` WHERE `char_id`="+$kill$+"", .@name$; if (!isloggedin(getcharid(3, .@name$)) query_sql "INSERT INTO `inventory` (`char_id`, `nameid`, `amount`, `equip`, `identify` ) VALUES ('"+$kill$+"', '"+.prize+"', '" +.amount+ "', 0, 1)"; else getitem .prize, .amount, getcharid(3, .@name$); end; Edited January 31, 2018 by Sindit 1 Quote Link to comment Share on other sites More sharing options...
0 pajodex Posted January 31, 2018 Group: Members Topic Count: 79 Topics Per Day: 0.03 Content Count: 439 Reputation: 173 Joined: 12/12/17 Last Seen: April 14 Author Share Posted January 31, 2018 11 minutes ago, Sindit said: Instead of use getcharid(0, $kill$), you just need to use $kill$ ($kill$ is actually saving the character id (char_id) and not the character name (name), so you don't need to use getcharid). Try this: OnClock0000: set .prize, 7227; set .amount, 5; query_sql "SELECT `char_id` FROM `char_reg_num` ORDER BY `key` = 'kills' DESC LIMIT 1", $kill$; query_sql "SELECT `name` FROM `char` WHERE `char_id`="+$kill$+"", .@name$; if (!isloggedin(getcharid(3, .@name$)) query_sql "INSERT INTO `inventory` (`char_id`, `nameid`, `amount`, `equip`, `identify` ) VALUES ('"+$kill$+"', '"+.prize+"', '" +.amount+ "', 0, 1)"; else getitem .prize, .amount, getcharid(3, .@name$); end; Thanks for the information about the $$ vars. Was totally unaware on it. However, I had some tutorials on discord with script experts and helped me with this. I used ROdex instead of this code. Your help is really appreciated. Quote Link to comment Share on other sites More sharing options...
Question
pajodex
Hi,
I'm getting console error:
[Error]: buildin_getcharid: Player with nick '150103' is not found. [Error]: buildin_getcharid: Player with nick '150103' is not found.
with this code:
OnClock0000: set .prize, 7227; set .amount, 5; query_sql "SELECT `char_id` FROM `char_reg_num` ORDER BY `key` = 'kills' DESC LIMIT 1",$kill$; set if (!isloggedin(getcharid(0, $kill$))) { query_sql "INSERT INTO `inventory` (`char_id`, `nameid`, `amount`, `equip`, `identify` ) VALUES ('" +getcharid(0, $kill$)+ "', '" +.prize+ "', '" +.amount+ "', 0, 1)"; } else getitem .prize, .amount, getcharid(0, $kill$); end;
I based it from this post xD
Regards~
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.