30.03.2016, 20:41
Hello there, I've been testing this on local server, and whenever my friend does "/accepthelp" the server closes automatically, what's the issue, it's bugging me and I can't seem to find it.
Код:
if(strcmp(cmd, "/accepthelp", true) == 0)
{
new id, msgstring[150];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /accepthelp [playerid]");
return 1;
}
id = strvalEx(tmp);
{
if(PlayerInfo[playerid][pHelper] >= 1)
{
if(IsPlayerConnected(id) && ActiveHelp[id] == 1)
{
if(HelpAccepted[id] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "* This player's help request has already been taken!");
return 1;
}
if(ActiveHelp[id] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "* This player doesn't have an active help request!");
return 1;
}
format(msgstring, sizeof(string), "You have accepted %s's help request.", GetName(id));
SendClientMessage(playerid, TEAM_AZTECAS_COLOR, msgstring);
format(msgstring, sizeof(string), "Community Advisor %s has taken your request and will be with you shortly.", sendername);
SendClientMessage(id, TEAM_AZTECAS_COLOR, msgstring);
format(msgstring, sizeof(string), "Community Advisor %s has taken %s's help request.", sendername, GetName(id));
SendHelperMessage(0x02CCCCFF, msgstring);
format(msgstring, sizeof(string), "[HELP TEXT:] %s", HelpText[id]);
SendClientMessage(playerid, COLOR_GREEN, msgstring);
SendClientMessage(playerid, COLOR_WHITE, "HINT: You are handling %s's request, you can use /hgoto, and /hgethere.");
SendClientMessage(playerid, COLOR_WHITE, "HINT: Use /reply [message] to talk to the help requester.");
SendClientMessage(id, COLOR_WHITE, "HINT: Use /reply [message] to talk with your advisor.");
IsHelping[playerid] = 1;
HelpAccepted[id] = 1;
HelpingWho[playerid] = GetName(id);
new CHANNEL = random(300);
HelperNewbieChannel[id] = CHANNEL;
HelperNewbieChannel[playerid] = CHANNEL;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "There are no active help requests from the player.");
}
}
}
return 1;

