Crashes my server...
#1

Every time I type this command in my server just crashes... Why is that?

pawn Код:
CMD:fac(playerid) return cmd_faction(playerid);
CMD:faction(playerid, params[])
{
    new string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!PlayerInfo[playerid][pFac]) return SendClientMessage(playerid, COLOR_GREY, "You are not in a faction.");
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, USAGE, "[Usage]: (/fac)tionchat [text]");
    format(string, sizeof(string), "** [FAC] %s %s: %s", RPFRN(playerid), RPN(playerid), params);
    SendPlayerFactionMessage(playerid, 0, COLOR_GREY, string);
    return 1;
}
pawn Код:
stock SendPlayerFactionMessage(playerid, rank, color, string[])
{
    foreach(Player, i)
    {
        if(IsPlayerLoggedIn(i) && PlayerInfo[i][pFac] == PlayerInfo[playerid][pFac] && PlayerInfo[i][pFacRank] >= rank)
        {
            SendClientMessage(i, color, string);
        }
    }
    return 1;
}
Reply
#2

Код:
CMD:fac(playerid) return cmd_faction(playerid);
CMD:faction(playerid, params[])
{
	new string[128];
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(!PlayerInfo[playerid][pFac]) return SendClientMessage(playerid, COLOR_GREY, "You are not in a faction.");
	if(sscanf(params, "string[128]", params)) return SendClientMessage(playerid, USAGE, "[Usage]: (/fac)tionchat [text]");
        format(string, sizeof(string), "** [FAC] %s %s: %s", RPFRN(playerid), RPN(playerid), params);
	SendPlayerFactionMessage(playerid, 0, COLOR_GREY, string);
	return 1;
}
Reply
#3

Quote:
Originally Posted by McBan
Посмотреть сообщение
Код:
CMD:fac(playerid) return cmd_faction(playerid);
CMD:faction(playerid, params[])
{
	new string[128];
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(!PlayerInfo[playerid][pFac]) return SendClientMessage(playerid, COLOR_GREY, "You are not in a faction.");
	if(sscanf(params, "string[128]", params)) return SendClientMessage(playerid, USAGE, "[Usage]: (/fac)tionchat [text]");
        format(string, sizeof(string), "** [FAC] %s %s: %s", RPFRN(playerid), RPN(playerid), params);
	SendPlayerFactionMessage(playerid, 0, COLOR_GREY, string);
	return 1;
}
Nope still crashing!
Reply
#4

pawn Код:
CMD:fac(playerid) return cmd_faction(playerid);
CMD:faction(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!PlayerInfo[playerid][pFac]) return SendClientMessage(playerid, COLOR_GREY, "You are not in a faction.");
    if(params[0] == EOS) return SendClientMessage(playerid, USAGE, "[Usage]: (/fac)tionchat [text]");
    //Do a parameter string length check?
    new string[128];
    format(string, sizeof(string), "** [FAC] %s %s: %s", RPFRN(playerid), RPN(playerid), params);
    SendPlayerFactionMessage(playerid, 0, COLOR_GREY, string);
    return 1;
}

stock SendPlayerFactionMessage(playerid, rank, color, const string[])
{
    foreach(new i : Player)
    {
        if(!IsPlayerLoggedIn(i)) continue;
        if(rank > PlayerInfo[i][pFacRank]) continue;
        if(PlayerInfo[i][pFac] == PlayerInfo[playerid][pFac]) SendClientMessage(i, color, string);
    }
    return 1;
}
Nothing wrong with this code, if it continues, install the crashdetect plugin.
Reply
#5

Quote:
Originally Posted by Threshold
Посмотреть сообщение
pawn Код:
CMD:fac(playerid) return cmd_faction(playerid);
CMD:faction(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!PlayerInfo[playerid][pFac]) return SendClientMessage(playerid, COLOR_GREY, "You are not in a faction.");
    if(params[0] == EOS) return SendClientMessage(playerid, USAGE, "[Usage]: (/fac)tionchat [text]");
    //Do a parameter string length check?
    new string[128];
    format(string, sizeof(string), "** [FAC] %s %s: %s", RPFRN(playerid), RPN(playerid), params);
    SendPlayerFactionMessage(playerid, 0, COLOR_GREY, string);
    return 1;
}

stock SendPlayerFactionMessage(playerid, rank, color, const string[])
{
    foreach(new i : Player)
    {
        if(!IsPlayerLoggedIn(i)) continue;
        if(rank > PlayerInfo[i][pFacRank]) continue;
        if(PlayerInfo[i][pFac] == PlayerInfo[playerid][pFac]) SendClientMessage(i, color, string);
    }
    return 1;
}
Nothing wrong with this code, if it continues, install the crashdetect plugin.
Still crashing so here is pastebin of crashdetect

http://pastebin.com/vHkEkx0S

Also it only happens when I type /faction
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)