27.10.2014, 04:46
(
Последний раз редактировалось Metroplex; 27.10.2014 в 05:42.
)
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);
}
}
}
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.