Text doesn't show - 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: Text doesn't show (
/showthread.php?tid=543515)
Text doesn't show -
Metroplex - 27.10.2014
pawn Код:
CMD:tk(playerid, params[])
{
if(mode[playerid] != 3) return 1;
if(GetPlayerTeam(playerid) != 233) return 0;
new Float:xyz[3], string[500], price;
GetPlayerPos(playerid, xyz[0], xyz[1], xyz[2]);
if(IsPlayerInRangeOfPoint(GetNearestPlayer(playerid), 25.0, xyz[0], xyz[1], xyz[2]))
{
if(!GetPlayerWantedLevel(GetNearestPlayer(playerid))) return SPM(playerid, "ERROR: The target is a civilian!");
price = GetPlayerWantedLevel(GetNearestPlayer(playerid))*1000;
GivePlayerMoney(playerid, price);
GivePlayerMoney(GetNearestPlayer(playerid), -price);
GivePlayerScore(playerid, 2);
PlayerInfo[playerid][CNRScore] += 3;
format(string, sizeof(string), "{FF0000}%s [%d]{FFFFFF} has issued a ticket {FF0000}%s [%d]{FFFFFF} for having %d stars on his head! +$%d, +2 scores, and +3 CNR Score!",GetName(playerid),playerid,GetName(GetNearestPlayer(playerid)),GetNearestPlayer(playerid),GetPlayerWantedLevel(GetNearestPlayer(playerid)),price);
SCNRM(string);
SetPlayerWantedLevel(GetNearestPlayer(playerid), 0);
}
else SPM(playerid, "ERROR: No players on range!");
return 1;
}
pawn Код:
stock SCNRM(string[])
{
new string1[500];
format(string1, sizeof(string1), "{FF0000}[CNR]: {FF0000}%s",string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(mode[i] == 3 && modeid[i] == 1)
{
SendClientMessage(i, -1, string1);
}
}
}
That is my (/tk) Ticket command. The problem is if I use it(it's fully functional) the text doesn't show(the "%s [%d]" things).
On the other hand, every SCNRM beside this script is working. I wonder why does this isn't working.
EDIT: I've tried Laurey's, still didn't work.
I don't want to use SendClientMessageToAll as it would spam the global chat.
Re: Text doesn't show -
Laurey - 27.10.2014
Try not using your custom stock, maybe try the default one, that might be working
pawn Код:
SendClientMessage(playerid, 1, string);
Re: Text doesn't show -
Metroplex - 27.10.2014
I have tried not using my own stock-- it's still the same.
Re: Text doesn't show -
Laurey - 27.10.2014
pawn Код:
stock SCNRM(string[])
{
new string1[500];
format(string1, sizeof(string1), "{FF0000}[CNR]: {FF0000}%s",string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(mode[i] == 3 && modeid[i] == 1)
{
SendClientMessage(i, -1, string1);
}
}
return 1;
}
Re: Text doesn't show -
Metroplex - 27.10.2014
Alright. Let me try that.
If I bump the thread it means it still didn't.
EDIT: Sorry I forgot the rules, I can't bump.