[CMD-Error] /warn
#1

Hi!
I got some errors. Canґt figure out how to fix it.

http://pastebin.com/fsEEWpXh

Any help is welcome
Reply
#2

show 1079 line
Reply
#3

Line 1079:

pawn Код:
format(str, sizeof (str), "[ADMIN]: %s has given %s a warning. (Reason: %s) (Warning: %d/%d)***", pName(playerid), pName(warned), params[1+strlen(tmp)], PlayerInfo[warned][Warnings], MAX_WARNINGS);
Reply
#4

Quote:
Originally Posted by Flashy
Line 1079:

pawn Код:
format(str, sizeof (str), "[ADMIN]: %s has given %s a warning. (Reason: %s) (Warning: %d/%d)***", pName(playerid), pName(warned), params[1+strlen(tmp)], PlayerInfo[warned][Warnings], MAX_WARNINGS);
destroy line
Reply
#5

Show line 1078
Reply
#6

Quote:
Originally Posted by Montis123
Quote:
Originally Posted by Flashy
Line 1079:

pawn Код:
format(str, sizeof (str), "[ADMIN]: %s has given %s a warning. (Reason: %s) (Warning: %d/%d)***", pName(playerid), pName(warned), params[1+strlen(tmp)], PlayerInfo[warned][Warnings], MAX_WARNINGS);
destroy line
What? xD I canґt delete this line cause this line sends a message who has been warned xD

Quote:
Originally Posted by Joe Torran C
Show line 1078
Lol. I have already post line 1079. SO watch in pastebin and see the line before. Not so difficult?


Any help pls?
Reply
#7

Код:
new pName[24],wName[24];
GetPlayerName(playerid,pName,24);
GetPlayerName(warned,wName,24);
format(str, sizeof (str), "[ADMIN]: %s has given %s a warning. (Reason: %s) (Warning: %d/%d)***", pName, wName, params[1+strlen(tmp)], PlayerInfo[warned][Warnings], MAX_WARNINGS);
Reply
#8

Код:
dcmd_warn(playerid,params[])
{
  	if(PlayerInfo[playerid][AdminLevel] < 1) return SendClientMessage(playerid, COLOR_BRIGHTRED,"ERROR: You are not a high enough level to use this command");
	
	new tmp[256], tmp2[256], Index;		
	tmp = strtok(params,Index);
	tmp2 = strtok(params,Index);
	  	
	if(!strlen(tmp) || !strlen(tmp2)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "USAGE: /warn [playerid] [reason]");
  	
	new pName[24], ReturnUserName[24], string[256];
	new warned = strval(tmp);
	
	GetPlayerName(playerid, pName, 24);
	GetPlayerName(warned, ReturnUserName, 24);
 	
	if(!IsPlayerConnected(playerid))) return SendClientMessage(playerid, COLOR_BRIGHTRED, "ERROR: Player is not connected");
	if(warned==playerid) return SendClientMessage(playerid, COLOR_BRIGHTRED, "ERROR: You cannot warn yourself");

 	SendAdminMsg(playerid,"WARN");
	PlayerInfo[warned][Warnings]++;
	if(PlayerInfo[warned][Warnings] == MAX_WARNINGS)
	{
		new File:KickFile = fopen("logs/KickLog.txt", io_append);
		format(str, sizeof (str), "[ADMIN]: %s (ID: %d) has kicked %s (ID: %d). (Reason: Reaching 3 Warnings.) (Warning: %d/%d)***", pName, playerid, ReturnUserName, ReturnPlayer, PlayerInfo[warned][Warnings], MAX_WARNINGS);
		SendClientMessageToAll(COLOR_BRIGHTRED, str);
		fwrite(KickFile, string);
		fclose(KickFile);
		Kick(warned);
		PlayerInfo[warned][Warnings] = 0;
	} 
		
	format(str, sizeof (str), "[ADMIN]: %s has given %s a warning. (Reason: %s) (Warning: %d/%d)***", pName, ReturnUserName, params[1+strlen(tmp)], PlayerInfo[warned][Warnings], MAX_WARNINGS);
	SendClientMessageToAll(COLOR_PINK, str);
				
	return 1;
}
Reply
#9

Sorry about that I use but do not want to assume another topic. I could ask for a command /warn [id] [reason], in the ordinary system cmd? ( if (strcmp ("/ command", cmdtext, 10, true) )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)