30.03.2019, 02:32
How can make that command to work with reason,because when I use that command,don't work so great...
HTML Code:
CMD:respect(playerid, params[]) { new Player, Reason[256]; new Str[2500]; //-------------------------------------------------------------------------- if(sscanf(params, "uS[256]", Player, Reason)) return SendUsage(playerid, "/Respect [ID/Name] [1/-1] [Reason]"); //-------------------------------------------------------------------------- else if(!IsPlayerConnected(Player)) return SendClientMessage(playerid, COLOR_ULTRARED, "{00FF40}Player not connected"); //-------------------------------------------------------------------------- else if(Player == playerid) return SendClientMessage(playerid, COLOR_ULTRARED, "{00FF40}You cannot give yourself respect!"); //-------------------------------------------------------------------------- else if((gettime() - rldtime[playerid]) < 180) return SendClientMessage(playerid, COLOR_ULTRARED, "{00FF40}Sorry, but you can give a point of respect only once in an 3 minutes!"); //-------------------------------------------------------------------------- else { //---------------------------------------------------------------------- if(CosminInfo[playerid][Like] == 0) { CosminInfo[Player][Like] += 1; format(Str, 2500, "{FFFF1A}You have recieved a positive respect point from %s with reason: %s",PlayerName(playerid), playerid, Reason); SendClientMessage(Player, COLOR_YELLOW, Str); format(Str, 2500, "{FFFF1A}You have given %s a positvive respect point with reason: %s", PlayerName(Player), playerid, Reason); SendClientMessage(playerid, COLOR_YELLOW, Str); rldtime[playerid] = gettime(); } //---------------------------------------------------------------------- else if(CosminInfo[playerid][Dislike] == 0) { CosminInfo[Player][Dislike] += 1; format(Str, 2500, "{FFFF1A}You have recieved a negative respect point from %s with reason: %s",PlayerName(playerid), playerid, Reason); SendClientMessage(Player, COLOR_YELLOW, Str); format(Str, 2500, "{FFFF1A}You have given %s a negative respect point with reason: %s", PlayerName(Player), playerid, Reason); SendClientMessage(playerid, COLOR_YELLOW, Str); rldtime[playerid] = gettime(); } //---------------------------------------------------------------------- } return 1; }