20.10.2013, 04:03
I can't seem to figure out two things, for some reason when ever you type /accepthelp [playerid] It will say everything accept where I have the ID. For example.
HelpWarn: BOB's has accepted ( )BILL's help request.
Also I need to add something to detact if a person has used /helpme.
Thanks will +rep who ever helps me first
HelpWarn: BOB's has accepted ( )BILL's help request.
Also I need to add something to detact if a person has used /helpme.
Код:
CMD:helpme(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][pHelper]) return SendClientMessage(playerid, COLOR_GREY, "You can't submit a help request as a helper."); if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /helpme [text]"); if(AntiAdv(playerid, params)) return 1; if(HelpTime[playerid] > 0) { format(string, sizeof(string), "You need to wait %d more seconds before making a help message again.", HelpTime[playerid]); SendClientMessage(playerid, COLOR_GREY, string); return 1; } format(string, sizeof(string), "Help Report from {FF6347}[%d] {FFFF91}%s: %s", playerid, RPN(playerid), params); SendHelperMessage(COLOR_REPORT, 1, string); format(string, sizeof(string), "Help Report from [%d] %s: %s", playerid, RPN(playerid), params); Log("logs/hreports.log", string); SendClientMessage(playerid, COLOR_YELLOW, "Your help request have been sent to the online helpers, Please be patient."); HelpTime[playerid] = 25; SetTimerEx("HelpTimer", 1000, false, "i", playerid); return 1; }
Код:
CMD:accepthelp(playerid, params[]) { new playerb, string[128]; if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command."); if(PlayerInfo[playerid][pHelper] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command."); if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /accepthelp [playerid]"); if(!IsPlayerLoggedIn(playerb) && !IsPlayerNPC(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id."); if(PlayerInfo[playerid][pHelper]) { format(string, sizeof(string), "Helper %s has accepted your help request. Contact him via /pm %s .", RPN(playerb), playerb); SendClientMessage(playerb, COLOR_WHITE, string); format(string, sizeof(string), "HelpWarn: %s's has accepted (%s)%s help request.", RPN(playerid), playerb, RPN(playerb)); SendHelperMessage(COLOR_DARKRED, 1, string); } return 1; }