Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Undefined Symbol

$
0
0
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

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;
}

Timer:

PHP Code:

forward banip();
public 
banip()
{
        for(new 
0MAX_BUSINESSESb++)
        {
            if(!
strcmp(BizInfo[b][bOwner], GetName(targetid), false))
            {
                
SellBiz(b);
            }
        }

        
UnloadPlayerVehicles(targetid);
        
RemoveOwnedVehs(targetid);

        
SendRconCommand(fstr2);
        
BanEx(targetidfstr);


When compiling

PHP Code:

C:\Users\Desktop\SERVER\gamemodes\LVCNR.pwn(22977) : error 017undefined symbol "targetid"
C:\Users\Desktop\SERVER\gamemodes\LVCNR.pwn(22983) : error 017undefined symbol "targetid"
C:\Users\Desktop\SERVER\gamemodes\LVCNR.pwn(22984) : error 017undefined symbol "targetid"
C:\Users\Desktop\SERVER\gamemodes\LVCNR.pwn(22987) : error 017undefined symbol "targetid"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase


4 Errors



Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>