SA-MP Forums Archive
little help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: little help (/showthread.php?tid=583125)



little help - TenTen - 26.07.2015

Код:
C:\Users\TRAFEH\Desktop\SA-MP\filterscripts\eAdmin.pwn(2236) : error 027: invalid character constant
C:\Users\TRAFEH\Desktop\SA-MP\filterscripts\eAdmin.pwn(2236) : error 027: invalid character constant
C:\Users\TRAFEH\Desktop\SA-MP\filterscripts\eAdmin.pwn(2238) : error 027: invalid character constant
C:\Users\TRAFEH\Desktop\SA-MP\filterscripts\eAdmin.pwn(2238) : error 027: invalid character constant
C:\Users\TRAFEH\Desktop\SA-MP\filterscripts\eAdmin.pwn(8669) : warning 217: loose indentation
Код:
	if(strcmp(cmd, "/uncage", true) == 0)
	{
		if(AccInfo[playerid][Level] < 4)
		return ErrorMessages(playerid, 5);

		new Index;
		new tmp[256];  tmp  = strtok(params, Index);
		new player1 = ReturnUser(tmp);
	  	new tmp2[256]; tmp2 = strtok(params, Index);

	 	if(!strlen(tmp)) return
	 	SendClientMessage(playerid, LIGHTBLUE, "[ USAGE: /uncage (player<name/id>)]") ;


		if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]))
		{

	    if(AccInfo[player1][pCaged] == 0)
		return SendClientMessage(playerid, red, "[ ERROR: Player is not in Cage. ]");

		new string[128];
		new playername[MAX_PLAYER_NAME];
		new adminname [MAX_PLAYER_NAME];
		SendCommandToAdmins(playerid,"unCage");
	 	GetPlayerName(player1, playername, sizeof(playername));
		GetPlayerName(playerid, adminname, sizeof(adminname));
		format(string, sizeof(string), "[ Administrator %s(%d) have unCaged \"%s(%d)\]",adminname,playerid, playername,player1);
		SendClientMessageToAll(red, string);
		format(string, sizeof(string), "[ ADMIN: You have unCaged \"%s(%d)\]",playername,player1);
		SendClientMessageToAll(red, string);
	    AccInfo[player1][pCaged] = 0;
		PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
		PlayerPlaySound(player1,1057,0.0,0.0,0.0);
	    UnCagePlayer(playerid);
  }
		else return ErrorMessages(playerid, 3);
		return 1;
		}
What's wrong?


Re: little help - IgorLuiz - 26.07.2015

You can inform at least the line of mistakes?


Re: little help - jamesbond007 - 26.07.2015

rofl wtf... cant believe threads like this still even exist ..
OP downloads a filterscript old as fuck.. it uses strtok, and then posts a command. no line numbers or anything xD
just why.. also indentation is fucked, and use [pawn] tags next time


Re: little help - Josh_Main - 26.07.2015

Hey man, comment out the line which the errors are on, we can't tell which lines it is, because they aren't numbered. Than I can help you out


AW: little help - Macronix - 26.07.2015

Код:
if(strcmp(cmd, "/uncage", true) == 0)
{
	if(AccInfo[playerid][Level] < 4)
	return ErrorMessages(playerid, 5);

	new Index;
	new tmp[256];  tmp  = strtok(params, Index);
	new player1 = ReturnUser(tmp);
  	new tmp2[256]; tmp2 = strtok(params, Index);

 	if(!strlen(tmp)) return
 	SendClientMessage(playerid, LIGHTBLUE, "[ USAGE: /uncage (player<name/id>)]") ;

	if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]))
	{
	    if(AccInfo[player1][pCaged] == 0)
		return SendClientMessage(playerid, red, "[ ERROR: Player is not in Cage. ]");

		new string[128];
		new playername[MAX_PLAYER_NAME];
		new adminname [MAX_PLAYER_NAME];
		SendCommandToAdmins(playerid,"unCage");
	 	GetPlayerName(player1, playername, sizeof(playername));
		GetPlayerName(playerid, adminname, sizeof(adminname));
		format(string, sizeof(string), "[ Administrator %s(%d) have unCaged \"%s(%d)\"]",adminname,playerid, playername,player1);
		SendClientMessageToAll(red, string);
		format(string, sizeof(string), "[ ADMIN: You have unCaged \"%s(%d)\"]",playername,player1);
		SendClientMessageToAll(red, string);
	    AccInfo[player1][pCaged] = 0;
		PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
		PlayerPlaySound(player1,1057,0.0,0.0,0.0);
	    UnCagePlayer(playerid);
	}
	else return ErrorMessages(playerid, 3);
	return 1;
}



Re: AW: little help - TenTen - 26.07.2015

Quote:
Originally Posted by Macronix
Посмотреть сообщение
Код:
if(strcmp(cmd, "/uncage", true) == 0)
{
	if(AccInfo[playerid][Level] < 4)
	return ErrorMessages(playerid, 5);

	new Index;
	new tmp[256];  tmp  = strtok(params, Index);
	new player1 = ReturnUser(tmp);
  	new tmp2[256]; tmp2 = strtok(params, Index);

 	if(!strlen(tmp)) return
 	SendClientMessage(playerid, LIGHTBLUE, "[ USAGE: /uncage (player<name/id>)]") ;

	if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]))
	{
	    if(AccInfo[player1][pCaged] == 0)
		return SendClientMessage(playerid, red, "[ ERROR: Player is not in Cage. ]");

		new string[128];
		new playername[MAX_PLAYER_NAME];
		new adminname [MAX_PLAYER_NAME];
		SendCommandToAdmins(playerid,"unCage");
	 	GetPlayerName(player1, playername, sizeof(playername));
		GetPlayerName(playerid, adminname, sizeof(adminname));
		format(string, sizeof(string), "[ Administrator %s(%d) have unCaged \"%s(%d)\"]",adminname,playerid, playername,player1);
		SendClientMessageToAll(red, string);
		format(string, sizeof(string), "[ ADMIN: You have unCaged \"%s(%d)\"]",playername,player1);
		SendClientMessageToAll(red, string);
	    AccInfo[player1][pCaged] = 0;
		PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
		PlayerPlaySound(player1,1057,0.0,0.0,0.0);
	    UnCagePlayer(playerid);
	}
	else return ErrorMessages(playerid, 3);
	return 1;
}
Thank you