I am using Vote for Points on my server, but I don't like the standalone "points" it uses, so I was wondering if there's a way to use SQL queries / commands or w/e from within a script as a OnPCLoginEvent to do something like this:
OnPCLoginEvent:
-- SQL Query cp_v4p_voters, check players 'account_id', get 'points' and asign value as a @VotePoints variable.
-- SQL Query Set cp_v4p_voters 'points' value to 0
set #CASHPOINTS, #CASHPOINTS+@VotePoints;'
I've looked at various scripts that use the SQL stuffs and cant seem to figure it out >.<...
EDIT:
I'm still playing arround with things, and I think I'm probably wayyy off (obviously, since it's not working) but could anyone point me in right direction from where I'm at now?
- script VotePoints -1,{
OnPCLoginEvent:
set .@account_id,getcharid(3);
set @vote_points,query_sql ("SELECT `points` FROM `cp_v4p_voters` WHERE `account_id' = ".@account_id");
set #CASHPOINTS,#CASHPOINTS+@vote_points";
dispbottom "You have "+#CASHPOINTS+" point(s)";
close;
end;
}
Question
Lige
I am using Vote for Points on my server, but I don't like the standalone "points" it uses, so I was wondering if there's a way to use SQL queries / commands or w/e from within a script as a OnPCLoginEvent to do something like this:
OnPCLoginEvent:
-- SQL Query cp_v4p_voters, check players 'account_id', get 'points' and asign value as a @VotePoints variable.
-- SQL Query Set cp_v4p_voters 'points' value to 0
set #CASHPOINTS, #CASHPOINTS+@VotePoints;'
I've looked at various scripts that use the SQL stuffs and cant seem to figure it out >.<...
EDIT:
I'm still playing arround with things, and I think I'm probably wayyy off (obviously, since it's not working) but could anyone point me in right direction from where I'm at now?
Edited by LigeLink 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.