i made callback to check if active is 1 or 0.
this is the code:
PHP Code:
public Action:Command_VipMenu(client,args)
{
decl String:auth[255];
GetClientAuthString(client,auth,sizeof(auth));
decl String:Query[255];
Format(Query, sizeof(Query), "SELECT active FROM donators WHERE steamid = '%s'", auth);
//SQL_TQuery(dData, T_CheckDonator, Query, client);
if(SQL_TQuery(dData, T_CheckDonator, Query, client)==1)
{
TopMenu(client);
}
else PrintToChat(client,"[\x02Donator\x01] You are not a donator");
}
the callback is:
PHP Code:
public T_CheckDonator(Handle:owner, Handle:hndl, const String:error[], any:theuser)
{
if (!IsClientConnected(theuser)) return 0;
if (hndl == INVALID_HANDLE)
{
LogError("Query failed! %s", error);
PrintToChatAll("a0");
return 0;
}
else
{
decl String:Clientsteamid[255];
GetClientAuthString(theuser, Clientsteamid, sizeof(Clientsteamid));
PrintToChatAll("%s",Clientsteamid);
if(SQL_FetchRow(hndl))
{
if(SQL_FetchInt(hndl,0)==0)
{
PrintToChatAll("b0");
return 0;
}
if(SQL_FetchInt(hndl,0)==1)
{
PrintToChatAll("1");
return 1;
}
else
{
PrintToChatAll("c0");
return 0;
}
}
else
{
PrintToChatAll("d0");
return 0;
}
}
}
i made the printtochat all in the callback to check where it goes.
if active=1 it goes into the return 1;
if active=0 it goes into PrintToChat("b0") and then return 0;
but in the command vipmenu it always opens the menu even if active is 0.
i need help pls.