SA-MP Forums Archive
3 Warning - 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: 3 Warning (/showthread.php?tid=448521)



3 Warning - D3vin - 04.07.2013

Im new to scripting and I've tried to make a name change system but I can't seem to get it to work, I keep getting 3 warning's when compiling it

Код:
#define FILTERSCRIPT
#include <a_samp>
#if defined FILTERSCRIPT
#include sscanf


public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Name Change V.1 by ");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

#endif

CMD:namechange(playerid, params[])
{
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(!IsPlayerInRangeOfPoint(playerid, 2, 361.8299,173.3985,1008.3828)) return SendClientMessage(playerid, COLOR_GREY, "You are not at the cityhall.");
	SSSShowDialog(playerid, 41);
	return 1;
}

CMD:approve(playerid, params[])
{
	new string[128], option[32];
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first beforeusing any command.");
	if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
	if(sscanf(params, "s[32]", option))
	{
	    SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /approve [option]");
        SendClientMessage(playerid, COLOR_GREY, "OPTIONS: namechange | pnamechange");
		return 1;
	}
	 else if(!strcmp(option, "namechange", true, 10))
	{
	    new playerb, parm[42];
        if(sscanf(params, "s[32]u", option, playerb)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /approve namechange [playerid]");
        if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to approve namechange requests.");
        if(!strlen(VIPName[playerb])) return SendClientMessage(playerid, COLOR_GREY, "Player hasn't requested a namechange.");
        format(parm, sizeof(parm), "%d %s", playerb, VIPName[playerb]);
        Approve[playerid] = 1;
        cmd_setname(playerid, parm);
        format(VIPName[playerb], MAX_PLAYER_NAME, "");
        }
        else SendClientMessage(playerid, COLOR_GREY, "Invalid option.");
		return 1;
}
 CMD:deny(playerid, params[])
{
     new string[128];
     if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
     if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
     if(sscanf(params, "s[32]", params))
     {
        SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /deny [option]");
        SendClientMessage(playerid, COLOR_GREY, "OPTIONS: taxrequest | namechange | pnamechange");
        return 1;
      }
       else if(!strcmp(params, "namechange", true, 10))
	  {
	    new playerb;
	    if(sscanf(params, "s[32]u", params, playerb)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /deny namechange [playerid]");
        if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to approve namechange requests.");
        if(!strlen(VIPName[playerb])) return SendClientMessage(playerid, COLOR_GREY, "Player hasn't requested a namechange.");
   		format(VIPName[playerb], MAX_PLAYER_NAME, "");
        format(string, sizeof(string), "AdmWarn: %s has denied %s's namechange request.", RPN(playerid), RPN(playerb));
        SendAdminMessage(COLOR_DARKRED, 1, string);
        format(string, sizeof(string), " Administrator %s has denied your namechange request.", RPN(playerid));
        SendClientMessage(playerb, COLOR_WHITE, string);
	  }
	   else SendClientMessage(playerid, COLOR_GREY, "Invalid option.");
	   return 1;
}



Re: 3 Warning - Steezy_ - 04.07.2013

Post the errors maybe.. we can't help ya without these, i don't have time to check every string..


Re: 3 Warning - Akira297 - 04.07.2013

Код:
C:\Users\\Desktop\test.pwn(90) : warning 203: symbol is never used: "approve"
C:\Users\\Desktop\test.pwn(90) : warning 203: symbol is never used: "deny"
C:\Users\\Desktop\test.pwn(90) : warning 203: symbol is never used: "namechange"
Are his errors.


Re: 3 Warning - D3vin - 04.07.2013

Quote:
Originally Posted by Akira297
Посмотреть сообщение
Код:
C:\Users\\Desktop\test.pwn(90) : warning 203: symbol is never used: "approve"
C:\Users\\Desktop\test.pwn(90) : warning 203: symbol is never used: "deny"
C:\Users\\Desktop\test.pwn(90) : warning 203: symbol is never used: "namechange"
Are his errors.
Quote:
Originally Posted by Steezy_
Посмотреть сообщение
Post the errors maybe.. we can't help ya without these, i don't have time to check every string..
those are the error's and I don't know what else I need to do to fix them


Re: 3 Warning - Konstantinos - 04.07.2013

They're warnings, not errors. Use them somewhere or just removed them, it clearly says that they are NEVER used!