event-player doesn't work #17

Closed
opened 2022-04-16 22:39:05 +00:00 by hiayaff · 6 comments

event-player returns none but when I enter the player's nickname normally, it works.

code that doesn't work:
on region enter:
if "%region%" contains "crab":
execute "SELECT * FROM test WHERE username= '%event-player%'" in {-sql} and store the result in {_output::*}
send "%{_output::username::1}%"

code that works:
on region enter:
if "%region%" contains "crab":
execute "SELECT * FROM test WHERE username= 'hiayaf'" in {-sql} and store the result in {_output::*}
send "%{_output::username::1}%"
probably the same with other expressions...

event-player returns none but when I enter the player's nickname normally, it works. code that doesn't work: on region enter: if "%region%" contains "crab": execute "SELECT * FROM `test` WHERE username= '**%event-player%**'" in {-sql} and store the result in {_output::*} send "%{_output::username::1}%" code that works: on region enter: if "%region%" contains "crab": execute "SELECT * FROM `test` WHERE username= '**hiayaf**'" in {-sql} and store the result in {_output::*} send "%{_output::username::1}%" probably the same with other expressions...
Author

image

![image](/attachments/a4b7e9fd-f07d-4ff2-af9f-5339a51e87ba)
5.4 KiB
Owner

player object is not serializable, you will need to use %player's name%

player object is not serializable, you will need to use %player's name%
Author

ok but if I give such a thing it does not work
execute "UPDATE test SET discoverisle=%{test::%player%}% WHERE username= '%name of player%'" in {-sql}

but when I give something like this it works
execute "UPDATE test SET discoverisle=%{test::%player%}% WHERE username= 'hiayaf'" in {-sql}

ok but if I give such a thing it does not work execute "UPDATE `test` SET `discoverisle`=%{test::%player%}% WHERE username= '%name of player%'" in {-sql} but when I give something like this it works execute "UPDATE `test` SET `discoverisle`=%{test::%player%}% WHERE username= 'hiayaf'" in {-sql}
hiayaff reopened this issue 2022-04-17 12:35:16 +00:00
Owner

try removing ' ' around the expression

try removing ' ' around the expression
Author

Oh thank you.
One more question, is it possible to send a player's balance from vault in expression

Oh thank you. One more question, is it possible to send a player's balance from vault in expression
Owner

%player's balance%

%player's balance%
Govindas added the
question
label 2022-04-28 20:11:43 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Limework/skript-db#17
No description provided.