String not displaying target's name. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: String not displaying target's name. (
/showthread.php?tid=590946)
String not displaying target's name. -
rangerxxll - 05.10.2015
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;
}
Re: String not displaying target's name. -
Jefff - 05.10.2015
Change to
pawn Код:
new gstring[145], target, reason[128];
Re: String not displaying target's name. -
rangerxxll - 05.10.2015
Quote:
Originally Posted by Jefff
Change to
pawn Код:
new gstring[145], target, reason[128];
|
Simple mistake. Thank you.