I'm trying to write a script where players can register for a tournament of up to 3 members per team and saves in the database. But I got stuck in the counting part.
I tried using this:
gm_room,76,56,5 script Tournament757,{
mes "Team Name";
input .@team_name;
next;
mes "test";for(set.@w,0;.@w<1;set.@w,.@w+1){
query_sql("SELECT SUM(`amount`) FROM `tournament` WHERE `team_name`='"+.@team_name+"'",.@amount);set.@total,.@total+(.@amount);}
mes "Found "+.@total+" x "+.@i+"";
query_sql "INSERT INTO `tournament` VALUES ( '', '"+.@id+"', '"+ getcharid(0)+"', '"+ strcharinfo(0)+"', '"+.@team_name+"', '1' , NOW() )";
close;
end;}
Question
Snaehild
Hi,
I'm trying to write a script where players can register for a tournament of up to 3 members per team and saves in the database. But I got stuck in the counting part.
I tried using this:
Link to comment
Share on other sites
8 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.