String not displaying target's name.
#1

The issue is where I sent a message, saying the VIP has started a votekick. It doesn't display the "target"' name when sending the string.


pawn Код:
CMD:votekick(playerid, params[])
{
    if(PlayerInfo[playerid][pVip] < 1) return SCM(pid,COLOR_GREY,ERROR);
    new gstring[150], target, reason;
    if(sscanf(params,"us[128]", target, reason)) return SCM(pid,COLOR_WHITE, "USAGE: /votekick [playerid] [reason]");
    if(target == INVALID_PLAYER_ID) return SCM(pid,COLOR_GREY, "That player is not connected.");
//  if(target == playerid) return SCM(pid,COLOR_GREY, "ERROR: You can't use that command on yourself.");
    if(VIP_VOTEKICK[target] > 0) return SCM(pid,COLOR_GREY, "ERROR: Vote kick is already in progress for that player.");
    if(PLAYER_VOTEKICK[playerid] == 1) return SCM(pid,COLOR_GREY, "ERROR: You've already voted to kick that player.");
    format(gstring,sizeof(gstring), "Global: {00E8E8}V.I.P %s {FFFFFF}has started a vote kick on %s. (Reason: %s)", GetName(playerid), GetName(target), reason);
    SCMA(COLOR_GREEN, gstring);
    VIP_VOTEKICK[target] +=1;
    PLAYER_VOTEKICK[playerid] = 1;
    return 1;
}
Reply
#2

Change to
pawn Код:
new gstring[145], target, reason[128];
Reply
#3

Quote:
Originally Posted by Jefff
Посмотреть сообщение
Change to
pawn Код:
new gstring[145], target, reason[128];
Simple mistake. Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)