SA-MP Forums Archive
help me we have 18 errors - 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 we have 18 errors (/showthread.php?tid=617638)



help me we have 18 errors - PrinceKumar - 24.09.2016

Код:
D:\ngg.script\pawno\include\dutils.inc(45) : warning 219: local variable "hour" shadows a variable at a preceding level
D:\ngg.script\pawno\include\dutils.inc(45) : warning 219: local variable "second" shadows a variable at a preceding level
./includes/functions.pwn(10695) : error 021: symbol already defined: "StripNewLine"
./includes/commands.pwn(12168) : warning 217: loose indentation
./includes/commands.pwn(12175) : warning 217: loose indentation
./includes/commands.pwn(37947) : error 017: undefined symbol "TogglePlayerBackpack"
./includes/commands.pwn(37988) : error 017: undefined symbol "TogglePlayerBackpack"
./includes/commands.pwn(38002) : error 017: undefined symbol "TogglePlayerBackpack"
./includes/commands.pwn(38011) : error 017: undefined symbol "TogglePlayerBackpack"
./includes/commands.pwn(38025) : error 017: undefined symbol "TogglePlayerBackpack"
./includes/commands.pwn(38034) : error 017: undefined symbol "TogglePlayerBackpack"
./includes/commands.pwn(38048) : error 017: undefined symbol "TogglePlayerBackpack"
./includes/commands.pwn(49052) : error 017: undefined symbol "TogglePlayerBackpack"
./includes/callbacks.pwn(4013) : error 017: undefined symbol "TogglePlayerBackpack"
./includes/OnDialogResponse.pwn(519) : error 017: undefined symbol "TogglePlayerBackpack"
./includes/OnDialogResponse.pwn(542) : error 017: undefined symbol "TogglePlayerBackpack"
./includes/OnDialogResponse.pwn(565) : error 017: undefined symbol "TogglePlayerBackpack"
./includes/OnDialogResponse.pwn(14072) : warning 219: local variable "Time" shadows a variable at a preceding level
./includes/OnDialogResponse.pwn(14093) : warning 219: local variable "Time" shadows a variable at a preceding level
./includes/OnDialogResponse.pwn(14114) : warning 219: local variable "Time" shadows a variable at a preceding level
./includes/backpack.pwn(36) : error 017: undefined symbol "PlayerHasBackpack"
./includes/backpack.pwn(45) : error 017: undefined symbol "PlayerHasBackpack"
./includes/backpack.pwn(49) : error 017: undefined symbol "TogglePlayerBackpack"
./includes/backpack.pwn(53) : error 017: undefined symbol "TogglePlayerBackpack"
./includes/backpack.pwn(61) : error 017: undefined symbol "PlayerHasBackpack"
D:\backpack\NGRP.pwn(61) : warning 203: symbol is never used: "strtok"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


18 Errors.



Re: help me we have 18 errors - MicroKyrr - 24.09.2016

Please show the code.


Re: help me we have 18 errors - PrinceKumar - 24.09.2016

Код:
line number 37947
CMD:removebackpack(playerid, params[])
{
	if (PlayerInfo[playerid][pAdmin] >= 1337)
	{
		new giveplayerid;
		if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /removebackpack [playerid]");

		if(IsPlayerConnected(giveplayerid))
		{
		    if(PBInfo[playerid][IsWearing] == true) TogglePlayerBackpack(playerid, false);
			new forrr[128];
			PBInfo[giveplayerid][HasBackpack] = 0;
			PBInfo[giveplayerid][Type] = 0;
		    format(forrr, sizeof(forrr), "AdmCmd: %s has removed %s's backpack!", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
		    SendClientMessageToAllEx(COLOR_LIGHTRED, forrr);
			PBInfo[playerid][Weed] = 0;
			PBInfo[playerid][Crack] = 0;
			PBInfo[playerid][IsWearing] = false;
			PBInfo[playerid][Materials] = 0;
			PBInfo[playerid][Gun1] = 0;
			PBInfo[playerid][Gun2] = 0;
			PBInfo[playerid][Gun3] = 0;
			PBInfo[playerid][Gun4] = 0;
			PBInfo[playerid][Gun5] = 0;
			PBInfo[playerid][Gun6] = 0;
			PBInfo[playerid][Gun7] = 0;
			PBInfo[playerid][Gun8] = 0;
		}
		else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
	}
	else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
	return 1;
}

line number 37988,38002,38011,38025,38048
MD:givebackpack(playerid, params[])
{
	if (PlayerInfo[playerid][pAdmin] >= 1337)
	{
		new giveplayerid, type;
		if(sscanf(params, "ud", giveplayerid, type)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /givebackpack [playerid] [type(0 small, 1 medium, 2 large)");

		if(IsPlayerConnected(giveplayerid))
		{
			new forrr[128];
			if(type == 0)
			{
			    PBInfo[giveplayerid][HasBackpack] = 1;
				format(forrr, sizeof(forrr), "AdmCmd: %s has given %s a small backpack!", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                PBInfo[giveplayerid][Type] = 0;
                SendClientMessageToAllEx(COLOR_LIGHTRED, forrr);
                if(PBInfo[giveplayerid][IsWearing] == true) TogglePlayerBackpack(giveplayerid, false);
				PBInfo[giveplayerid][Weed] = 0;
				PBInfo[giveplayerid][Crack] = 0;
				PBInfo[giveplayerid][IsWearing] = false;
				PBInfo[giveplayerid][Materials] = 0;
				PBInfo[giveplayerid][Gun1] = 0;
				PBInfo[giveplayerid][Gun2] = 0;
				PBInfo[giveplayerid][Gun3] = 0;
				PBInfo[giveplayerid][Gun4] = 0;
				PBInfo[giveplayerid][Gun5] = 0;
				PBInfo[giveplayerid][Gun6] = 0;
				PBInfo[giveplayerid][Gun7] = 0;
				PBInfo[giveplayerid][Gun8] = 0;
				PBInfo[giveplayerid][IsWearing] = true;
				TogglePlayerBackpack(giveplayerid, true);
				SendClientMessage(giveplayerid, -1, "{FFD700}You are now wearing a small backpack");
			}
			else if(type == 1)
			{
			    PBInfo[giveplayerid][HasBackpack] = 1;
				format(forrr, sizeof(forrr), "AdmCmd: %s has given %s a medium backpack!", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                PBInfo[giveplayerid][Type] = 1;
                SendClientMessageToAllEx(COLOR_LIGHTRED, forrr);
                if(PBInfo[giveplayerid][IsWearing] == true) TogglePlayerBackpack(giveplayerid, false);
				PBInfo[giveplayerid][Weed] = 0;
				PBInfo[giveplayerid][Crack] = 0;
				PBInfo[giveplayerid][IsWearing] = false;
				PBInfo[giveplayerid][Materials] = 0;
				PBInfo[giveplayerid][Gun1] = 0;
				PBInfo[giveplayerid][Gun2] = 0;
				PBInfo[giveplayerid][Gun3] = 0;
				PBInfo[giveplayerid][Gun4] = 0;
				PBInfo[giveplayerid][Gun5] = 0;
				PBInfo[giveplayerid][Gun6] = 0;
				PBInfo[giveplayerid][Gun7] = 0;
				PBInfo[giveplayerid][Gun8] = 0;
				PBInfo[giveplayerid][IsWearing] = true;
				TogglePlayerBackpack(giveplayerid, true);
				SendClientMessage(giveplayerid, -1, "{FFD700}You are now wearing a medium backpack");
			}
			else if(type == 2)
			{
                PBInfo[giveplayerid][HasBackpack] = 1;
				format(forrr, sizeof(forrr), "AdmCmd: %s has given %s a large backpack!", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                PBInfo[giveplayerid][Type] = 2;
                SendClientMessageToAllEx(COLOR_LIGHTRED, forrr);
                if(PBInfo[giveplayerid][IsWearing] == true) TogglePlayerBackpack(giveplayerid, false);
				PBInfo[giveplayerid][Weed] = 0;
				PBInfo[giveplayerid][Crack] = 0;
				PBInfo[giveplayerid][IsWearing] = false;
				PBInfo[giveplayerid][Materials] = 0;
				PBInfo[giveplayerid][Gun1] = 0;
				PBInfo[giveplayerid][Gun2] = 0;
				PBInfo[giveplayerid][Gun3] = 0;
				PBInfo[giveplayerid][Gun4] = 0;
				PBInfo[giveplayerid][Gun5] = 0;
				PBInfo[giveplayerid][Gun6] = 0;
				PBInfo[giveplayerid][Gun7] = 0;
				PBInfo[giveplayerid][Gun8] = 0;
				PBInfo[giveplayerid][IsWearing] = true;
				TogglePlayerBackpack(giveplayerid, true);
				SendClientMessage(giveplayerid, -1, "{FFD700}You are now wearing a large backpack");
			}
			else
			{
                SendClientMessageEx(playerid, COLOR_GRAD1, "Types are 0 for small, 1 for medium and 2 for large!");
			}
			return 1;
		}
		else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
	}
	else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
	return 1;
}
line number 36
CMD:bpedit(playerid, params[])
{
	if(!PlayerHasBackpack(playerid)) return SendClientMessage(playerid, COLOR_RED, "You do not have a backpack!");
	if(PBInfo[playerid][IsWearing] == false) return SendClientMessage(playerid, COLOR_RED, "You are not wearing your backpack!");
	EditAttachedObject(playerid, 7);
	//SetPVarInt(playerid, "EditingObjectBackpackTrue", 1); If I find the real public OnPlayerEditAttachedObject in the script, check for the PVar and then return 1; so it dont give out the toy menu!
	return 1;
}
line number 519 , 542 , 565

TogglePlayerBackpack(playerid, true)
here is the errors


Re: help me we have 18 errors - MicroKyrr - 24.09.2016

Did you define TogglePlayerBackPack? Did you also define StripNewLine twice?


Re: help me we have 18 errors - PrinceKumar - 24.09.2016

go and see the line


Re: help me we have 18 errors - PrinceKumar - 24.09.2016

please help me


Re: help me we have 18 errors - Fairuz - 24.09.2016

You say that you are a scripter,but you don't understand what's the meaning of this error...

TogglePlayerBackpack is not defined,you should make a function of them.


Re: help me we have 18 errors - PrinceKumar - 24.09.2016

i am not scripter i am just using this account this is my friend account my true account is "luckyguyxd" i cant new thread so im just borrowing this account


Re: help me we have 18 errors - Private200 - 24.09.2016

1. You have already defined hour and second in your main gamemode (defined twice in total).
2. StripNewLine has already been defined within a function.
3. TogglePlayerBackpack is a function you have not defined in the context it is being used (new TogglePlayerBackpack or however it has to be).
4. As I already pointed in #no1, you have already defined Time in another context and are redefining it in the context around lines 14k
5. NGG is not a gamemode a new scripter should work on.

If you don't know the meaning of those errors, please, try not to script for other servers (talking about your signature).