27.10.2012, 14:20
(
Последний раз редактировалось Fernado Samuel; 04.10.2013 в 18:27.
)
Removed
CMD:unban(playerid,params[])
{
new Target[24],query[200];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"You are not authorized to use this command");
if(sscanf(params,"s[24]",Target)) return SendClientMessage(playerid,-1,"USAGE:/unban [PlayerName]");
format(query,sizeof(query),"SELECT * FROM tablename WHERE Name=`%s`",Target);
mysql_function_query(Connection,query,true,"Unbanfunction","is",playerid,Target);
return 1;
}
forward Unbanfunction(playerid,Target[]);
public Unbanfunction(playerid,Target[])
{
new field,row,Message[128];
new query[200];
cache_get_data(row,field,connection);
if(!rows)
{
format(Message,sizeof(Message),"Player %s doesn't exist",Target);
SendClientMessage(playerid,-1,Message);
return 1;
}
else
{
fomrat(query,sizeof(query),"UPDATE tablename SET Banned=0 WHERE Name='%s'",Target);
mysql_function_query(Connection,query,false,"","");
SendClientMessage(playerid,-1,"Player has been unbanned");
}
return 1;
}