21.05.2016, 13:48
Hello.
i wanna make a system that checks if the player is banned.
this is what I got now, but it doesn't work.
If you are banned you are inside a table which is called "Suspended".
If you are not banned, you are not in that table at all.
Can someone help me?
i wanna make a system that checks if the player is banned.
this is what I got now, but it doesn't work.
pawn Код:
public OnPlayerConnect(playerid)
{
//Login / Register
new name[MAX_PLAYER_NAME],query[128],query2[128],nome[ MAX_STRING ], playerserial[128],playerip[32];
format(query2,sizeof(query2),"SELECT * FROM `suspended` WHERE username='%s'",name);
mysql_function_query(dbhandle,query2,true,"SuspendCheck","i",playerid);
GetPlayerName(playerid, name, sizeof(name));
format(query,sizeof(query),"SELECT id FROM user WHERE username='%s'",name);
mysql_function_query(dbhandle,query,true,"OnUserCheck","i",playerid);
gpci(playerid,playerserial,sizeof(playerserial));
GetPlayerIp(playerid,playerip,32);
format( nome, sizeof(nome), "14[JOIN] %s[%d] has joined Syndicate Roleplay. (IP: %s) (GPCI: %s ) | Online: %d",PlayerName(playerid), playerid, playerip,playerserial, ConnectedPlayers());
iEcho( nome );
return 1;
}
public SuspendCheck(playerid)
{
new num_rows,num_fields;
cache_get_data(num_rows,num_fields,dbhandle);
if(num_rows==0)
{
return 1;
}
else
{
Kick (playerid);
}
return 1;
}
If you are banned you are inside a table which is called "Suspended".
If you are not banned, you are not in that table at all.
Can someone help me?