SA-MP Forums Archive
Help me boys - 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: Help me boys (/showthread.php?tid=605799)



Help me boys - Rafaeloo - 24.04.2016

PHP код:
E:\fcr.pwn(24294) : error 021symbol already defined"SendAdminMessage"
E:\fcr.pwn(24321) : warning 219local variable "str" shadows a variable at a preceding level
E
:\fcr.pwn(24328) : error 017undefined symbol "SendHelperMessage"
E:\fcr.pwn(24342) : error 017undefined symbol "SendHelperMessage"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
3 Errors

Код:
CMD:newb(playerid,params[])
{
    new str[128];
    if(gPlayerLogged[playerid] == 0)
		return SendClientMessage(playerid, COLOR_GREY, "You're not logged in.");
    if(AntiAdv(playerid, params)) return 1;
	if((nonewbie) && PlayerInfo[playerid][pAdmin] < 1)
		return SendClientMessage(playerid, COLOR_GRAD2, "The newbie chat channel has been disabled by an Admin!");
	if(gNewbie[playerid] == 1)
		return SendClientMessage(playerid, COLOR_GREY, "You have the channel toggled, /tognewbie to re-enable!");
	if(isnull(params))
		return SendClientMessage(playerid, COLOR_WHITE, "Perdorimi: (/newb)ie [text]");
	if(PlayerInfo[playerid][pNMute] == 1)
		return SendClientMessage(playerid, COLOR_GREY, "You're muted from the newbie chat channel.");
	if(PlayerInfo[playerid][pHelper] >= 1 || PlayerInfo[playerid][pAdmin] >= 1)
	{
		new giveplayerid, message[128], string[128], str[80];
		if(sscanf(params,"is[80]",giveplayerid,str)) SendClientMessage(playerid, COLOR_WHITE, "Perdorimi: /newb [id] [pergjigje]");
		if(strlen(str) > 80) return SendClientMessage(playerid, COLOR_WHITE, "Mesazhi juaj nuk mund te jete me shume se 80 shkronja.");
		if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "Ai lojtar nuk eshte i konektuar!");
		format(string, sizeof(string), "Pergjigje nga: [%s]: %s", GetPlayerNameEx(playerid), str);
		SendClientMessage(giveplayerid, COLOR_NEWBIE, string);
		format(message, sizeof(message), "%s >> %s: %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), str);
		SendHelperMessage(COLOR_NEWBIE,message);
		SendAdminMessage(COLOR_NEWBIE,message);
		Log("logs/nnewb.log", message);
		PlayerInfo[playerid][pAcceptReport]++;
	}
	else
	{
    	if(sscanf(params,"s[128]",str)) SendClientMessage(playerid,-1,"Perdorimi: /newb [pyetja]");
    	new name[MAX_PLAYER_NAME],msg[110],string[128];
		GetPlayerName(playerid,name,20);
    	format(msg,sizeof(msg),"Nje lojtar ka nevoje per ndihme: %s(%d): %s",name,playerid,str);
		for(new i=0;i<MAX_PLAYERS;++i)
 	   {
    	    if(IsPlayerConnected(i) && PlayerInfo[i][pHelper] >= 1 && PlayerInfo[i][pAdmin] >=1)
		    SendHelperMessage(COLOR_NEWBIE,msg);
		    SendAdminMessage(COLOR_NEWBIE,msg);
    	}
		format(string, sizeof(string), "Mesazhi juaj: %s, eshte derguar, prisni derisa helperat t'ju kthejne pergjigje.", str);
		SendClientMessageEx(playerid, COLOR_NEWBIE, string);
		Log("logs/nnewb.log", msg);
    }
    return 1;
}

How to fix?


Re: Help me boys - DTV - 24.04.2016

First error means that you already have the SendAdminMessage function created somewhere, search your script to see if you can find a duplicate somewhere.

The warning is pertaining to the command where you have the "str" variable called earlier in the command.

pawn Код:
if(PlayerInfo[playerid][pHelper] >= 1 || PlayerInfo[playerid][pAdmin] >= 1)
    {
        new giveplayerid, message[128], string[128], str[80];
The "str" here isn't needed as it's already declared at the top of the command, so you don't need to create it again.

The last two errors mean that there's no function in the script called SendHelperMessage.


Re: Help me boys - povargek - 24.04.2016

Maybe you confused SendHelperMessage with SendHelperMessage on definition