this fucking error
#1

This is the code
Код:
CMD:banex(playerid, params[], help)
{
	new id, uip, reason[128], string[256];
	if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY, "Only for admins!");
	if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_WHITE, "> /banex <Name/Playerid> <reason>");
	if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: Player not connected.");
    GetPlayerIp(id, uip, sizeof(uip));
	if(PlayerInfo[id][pAdmin] >= 1)
	{
		if(PlayerInfo[playerid][pAdmin] >= 4)
		{
		    format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", RPName(id), RPName(playerid), reason);
	        SendClientMessageToAll(COLOR_LIGHTBLUE, string);
	        BanLog(string);
			format(string, sizeof(string),"banip %s", uip);
			SendRconCommand(string);
			SendRconCommand("reloadbans");
		}
		else
		{
		    SendClientMessage(playerid, COLOR_GREY, "You can't ban a staff member!");
		}
		return 1;
	}
	
	format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", RPName(id), RPName(playerid), reason);
 	SendClientMessageToAll(COLOR_LIGHTBLUE, string);
  	BanLog(string);
   	format(string, sizeof(string),"banip %s", uip);
	SendRconCommand(string);
	SendRconCommand("reloadbans");
	return 1;
}
And this is the error
Код:
C:\Users\andrei\Desktop\Scripting SA-MP\Basic RP Script Scratch FIX\gamemodes\U1.pwn(1623) : error 035: argument type mismatch (argument 2)
C:\Users\andrei\Desktop\Scripting SA-MP\Basic RP Script Scratch FIX\gamemodes\U1.pwn(1623) : error 035: argument type mismatch (argument 2)
What did I do wrong , I just want to get his IP and use it later..
Reply
#2

IP must be a string and don't create such stupid topic names ...
Reply
#3

Can you show me an example? I don't get it
Reply
#4

Quote:
Originally Posted by [Bios]Marcel
Посмотреть сообщение
IP must be a string and don't create such stupid topic names ...

Код:
CMD:banex(playerid, params[], help)
{
	if(PlayerInfo[playerid][pAdmin] < 4) return 0;
	
	new
	targetid,
	treason[64],
	string[128];

	if(sscanf(params, "us[128]", targetid, treason))
	   return SendClientMessage(playerid, COLOR_WHITE, "> /banex <name/playerid>");
	   
	if(targetid == INVALID_PLAYER_ID)
	   return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: Player not connected.");
	   
	if(PlayerInfo[playerid][pAdmin] > PlayerInfo[targetid][pAdmin])
	   return SendClientMessage(playerid, COLOR_GREY, "You can't ban a staff member!");
	   
	new
	targetip[16];
	
	GetPlayerIp(targetid, targetip, sizeof(targetip));

	format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", RPName(targetid), RPName(playerid), reason);
	SendClientMessageToAll(COLOR_LIGHTBLUE, string);
    BanLog(string);
	format(string, sizeof(string),"banip %s", targetip);
	SendRconCommand(string);
	SendRconCommand("reloadbans");

	return 1;
}
Reply
#5

Sorry but how do you not get that? Did you just copy that code somewhere?
Reply
#6

I got it now, no, I made it but when you said it must be a string I thought of something else, thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)