CMD:togapps(playerid, params[])
{
if(playerVariables[playerid][pGroupRank] == 7 && playerVariables[playerid][pGroup] != 0)
{
new stringy2[256], app;
mysql_format(handle, stringy2, 256, "SELECT * FROM `groups` WHERE `groupID` = '%d'", playerVariables[playerid][pGroup]);
new Cache: resultd = mysql_query(handle, stringy2);
if(cache_get_row_count() != 0)
{
cache_get_field_content(0, "groupApplication", result); app = strval(result);
}
cache_delete(resultd);
if(app == 1)
{
SCM(playerid, -1, "The applications are now offline.");
mysql_format(handle, stringy2, 256, "UPDATE `groups` SET `groupApplication` = '0' WHERE `groupID` = '%d'", playerVariables[playerid][pGroup]);
mysql_tquery(handle, stringy2);
}
else if(app == 0)
{
SCM(playerid, -1, "The applications are now online.");
mysql_format(handle, stringy2, 256, "UPDATE `groups` SET `groupApplication` = '1' WHERE `groupID` = '%d'", playerVariables[playerid][pGroup]);
mysql_tquery(handle, stringy2);
}
}
else
{
SCM(playerid, -1, "You are not a faction leader!");
}
return 1;
}
Asta-i ultima!