24.05.2012, 03:14
I have this on OnPlayerConnect
Which checks the ban from here
Then the check response from here
The problem is, when I ban someone, he connects, but doesn't get kick, how do I apply kick(playerid) on the check response, so the player get kicked,
I also tried adding Kick(playerid) on the check response but says undefined symbol playerid
PHP код:
CheckBan(playerid)
PHP код:
stock CheckBan(playerid)
{
format(post_string, sizeof(post_string), "action=checkip&apikey="#APIKEY"&ban_ip=%s", ips[playerid]);
HTTP(playerid, HTTP_POST, APIPATH, post_string, "OnCheckResponse");
return 1;
}
PHP код:
public OnCheckResponse(index, response_code, data[])
{
if(response_code == 200)
{
if(sscanf(data, "p?ss", error, code)) printf("[SAMP-BANS]: Error, API responded with: %s", data);
else if(strcmp(error, "Success", true) == 0)
{
SendClientMessage(index, 0xFFFFFF, code);
Kick(index);
printf("[SAMP-BANS]: %s", code);*/
new playerid[MAX_PLAYERS], string[128];
SendClientMessage(playerid, 0xFFFFFFFF, "You are banned from {FF9900}xxxxxx");
Kick(playerid); // Tried adding the above 2 lines and this line, but getting errors :/
//return 1;
}
else if(strcmp(code, "Ban not found")) printf("[SAMP-BANS]: Error, API responded with: %s", code);
}
else printf("[SAMP-BANS]: Encountered an error, the page didn't respond");
}
I also tried adding Kick(playerid) on the check response but says undefined symbol playerid