I want to set a timer for a ban ,so player can reach messages before server closes the connection but i'm unable to use target id into the timer
Timer:
When compiling
Code:
CMD:banip(playerid, params[])
{
new targetid, ip[50], reason[24];
if(PlayerInfo[playerid][aLevel] < 3) return SendClientMessage(playerid, RED, "SERVER: Unknown command.");
if(sscanf(params, "us[24]", targetid, reason)) return SendClientMessage(playerid, RED, "[Usage]: /banip [name/id] [reason]");
if(strlen(reason) < 1 || strlen(reason) > 24) return SendClientMessage(playerid, RED, "Your reason can only contain 1-24 characters.");
if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, RED, "Player not found.");
{
PlayerInfo[targetid][Banned] = 1;
format(fstr, sizeof(fstr), "Admin %s [%d] has banned %s [%d] - Reason: %s", GetName(playerid), playerid, GetName(targetid), targetid, reason);
SendClientMessageToAll(RED, fstr);
GetPlayerIp(targetid, ip, sizeof(ip));
format(fstr2, sizeof(fstr2), "banip %s",ip);
GameTextForPlayer(targetid, "~r~Banned", 5000, 5);
format(fstr3, sizeof(fstr3), "You have been banned . You were banned by admin %s.", GetName(playerid));
SendClientMessage(targetid, RED, fstr3);
SendClientMessage(targetid, ORANGE, "If you think this range ban is unfair post an appeal at forum");
SetTimer("banip", 1000, false);
}
return true;
}
PHP Code:
forward banip();
public banip()
{
for(new b = 0; b < MAX_BUSINESSES; b++)
{
if(!strcmp(BizInfo[b][bOwner], GetName(targetid), false))
{
SellBiz(b);
}
}
UnloadPlayerVehicles(targetid);
RemoveOwnedVehs(targetid);
SendRconCommand(fstr2);
BanEx(targetid, fstr);
}
PHP Code:
C:\Users\Desktop\SERVER\gamemodes\LVCNR.pwn(22977) : error 017: undefined symbol "targetid"
C:\Users\Desktop\SERVER\gamemodes\LVCNR.pwn(22983) : error 017: undefined symbol "targetid"
C:\Users\Desktop\SERVER\gamemodes\LVCNR.pwn(22984) : error 017: undefined symbol "targetid"
C:\Users\Desktop\SERVER\gamemodes\LVCNR.pwn(22987) : error 017: undefined symbol "targetid"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.