PM command crashing server
#1

This command is supposed to send a message to another player, and to admins so they can see it for safety.
But it crashes the server for some reason, no warnings in the script, and it looks to work for me.
pawn Код:
CMD:pm(playerid, params[])
{
    new targetid, text[128], string[128];
    if(sscanf(params, "s[128]", targetid, text)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /pm [playerid] [text]");
    if(PmOff[targetid] == 1) return SendClientMessage(playerid, COLOR_GREY, "Player has disabled Private Messages.");
    if(PmOff[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "You have disabled Private Messages, /toggle pm to enable them.");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "That player is not connected.");
    format(string, sizeof(string), "** PM to %s (ID: %i): %s", GetName(targetid), targetid, text);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    format(string, sizeof(string), "** PM from %s (ID: %i): %s", GetName(playerid), playerid, text);
    SendClientMessage(targetid, COLOR_YELLOW, string);
    format(string, sizeof(string), "** PM %s (%i) > %s (%i): %s", GetName(playerid), playerid, GetName(targetid), targetid, text);
    SendAdminMessage(2, COLOR_GREY, string);
    return 1;
}
Reply


Messages In This Thread
PM command crashing server - by CalvinC - 09.01.2015, 19:06
Re: PM command crashing server - by bgedition - 09.01.2015, 19:14
Re: PM command crashing server - by CalvinC - 09.01.2015, 19:24
Re: PM command crashing server - by JeaSon - 09.01.2015, 19:27
Re: PM command crashing server - by bgedition - 09.01.2015, 19:35

Forum Jump:


Users browsing this thread: 1 Guest(s)