AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   0 (https://forums.alliedmods.net/showthread.php?t=234056)

Kellan123 01-24-2014 12:08

0.

matsi 01-24-2014 14:11

Re: Rank System [Problem]
 
This is something i used in my old pointsystem plugin:
Code:
public CmdShowRank( client ) {     new szTemp[ 512 ], Data[ 1 ];         Data[ 0 ] = client;         format( szTemp, charsmax( szTemp ), "SELECT COUNT(*) AS rank FROM `pointsystem` WHERE `points` >= %i UNION SELECT COUNT(*) FROM `pointsystem` WHERE `points` >= '0'", gPoints[ client ] );         SQL_ThreadQuery( g_sql_tuple, "HandleRank", szTemp, Data, 1 ); } public HandleRank( FailState, Handle:Query, Error[], Errcode, Data[], DataSize ) {     if( FailState )     {         log_amx("SQL Error: %s (%d)", Error, Errcode)         return PLUGIN_HANDLED     }     new rank, total, client;         client = Data[ 0 ];         while ( SQL_MoreResults( Query ) )     {         if( rank )         {             total = SQL_ReadResult( Query, SQL_FieldNameToNum( Query, "rank" ) );         }         else         {             rank = SQL_ReadResult( Query, SQL_FieldNameToNum( Query, "rank" ) );         }         SQL_NextRow( Query );     }     Print( client, "You are ranked as %i of %i players with %i points", rank, total, gPoints[ client ] );         return PLUGIN_HANDLED; }

Kellan123 01-24-2014 14:26

Re: Rank System [Problem]
 
Sss


All times are GMT -4. The time now is 10:03.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.