SA-MP Forums Archive
How should I fix this? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How should I fix this? (/showthread.php?tid=219232)



How should I fix this? - .Com - 01.02.2011

Quote:

C:\Documents and Settings\Administrator.ZAP-SERVER\Desktop\Last server\gamemodes\lslrp.pwn(42069) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Administrator.ZAP-SERVER\Desktop\Last server\gamemodes\lslrp.pwn(42353) : error 017: undefined symbol "UsingTazer"
C:\Documents and Settings\Administrator.ZAP-SERVER\Desktop\Last server\gamemodes\lslrp.pwn(42353) : warning 215: expression has no effect
C:\Documents and Settings\Administrator.ZAP-SERVER\Desktop\Last server\gamemodes\lslrp.pwn(42353) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Administrator.ZAP-SERVER\Desktop\Last server\gamemodes\lslrp.pwn(42353) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator.ZAP-SERVER\Desktop\Last server\gamemodes\lslrp.pwn(42353) : fatal error 107: too many error messages on one line

Код:
	if(strcmp(cmd, "/tazer", true) ==0 || strcmp(cmd, "/ta", true) ==0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 ||  PlayerInfo[playerid][pMember] == 14)
			{
			    if(IsPlayerInAnyVehicle(playerid))
			    {
			        SendClientMessage(playerid, COLOR_GREY, "   Cannot use this while being in the Car!");
			        return 1;
			    }

			    if(UsingTazer[playerid] == 0)
				{
				    GetPlayerWeaponData(playerid, 2, SaveHandGun[playerid][0],SaveHandGun[playerid][1]);
				    GivePlayerWeapon(playerid, 23, 40);
				    UsingTazer[playerid]=1;
					GetPlayerName(playerid, sendername, sizeof(sendername));
					GiveNameSpace(sendername);
					if(PlayerInfo[playerid][pMaskUse] == 1) { format(sendername, sizeof(sendername), "Stranger_%d", RandMask[playerid]); }
					format(string, sizeof(string), "* %s unholsters his tazer from his duty belt.", sendername);
					ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				}
				else
				{
					GetPlayerName(playerid, sendername, sizeof(sendername));
					GivePlayerWeapon(playerid, 24, 0);
					GivePlayerWeapon(playerid, SaveHandGun[playerid][0], SaveHandGun[playerid][1]);
					GiveNameSpace(sendername);
					UsingTazer[playerid]=0;
					if(PlayerInfo[playerid][pMaskUse] == 1) { format(sendername, sizeof(sendername), "Stranger_%d", RandMask[playerid]); }
					format(string, sizeof(string), "* %s holsters his tazer into his duty belt.", sendername);
					ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "   You are not a Cop!");
			}
		}
	    return 1;
	}



Re: How should I fix this? - Marricio - 01.02.2011

new UsingTazer[MAX_PLAYERS];

PS: Next time dont copy&paste


Re: How should I fix this? - .Com - 01.02.2011

Added it but still not working.
I just wanted a decent tazer system :P


Re: How should I fix this? - Marricio - 01.02.2011

show the lines where are the errors


Re: How should I fix this? - admantis - 01.02.2011

every experienced scripted should know that these errors are caused because your array (UsingTazer) is not defined


Re: How should I fix this? - .Com - 01.02.2011

C:\Documents and Settings\Administrator.ZAP-SERVER\Desktop\Last server\gamemodes\lslrp.pwn(4235 : error 017: undefined symbol "SaveHandGun"
C:\Documents and Settings\Administrator.ZAP-SERVER\Desktop\Last server\gamemodes\lslrp.pwn(4235 : warning 215: expression has no effect
C:\Documents and Settings\Administrator.ZAP-SERVER\Desktop\Last server\gamemodes\lslrp.pwn(4235 : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Administrator.ZAP-SERVER\Desktop\Last server\gamemodes\lslrp.pwn(4235 : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator.ZAP-SERVER\Desktop\Last server\gamemodes\lslrp.pwn(4235 : fatal error 107: too many error messages on one

Код:
				    GetPlayerWeaponData(playerid, 2, SaveHandGun[playerid][0],SaveHandGun[playerid][1]);
This is all one line

and sorry admantis that I am still learning.
Thank you to the people that are helping me


Re: How should I fix this? - Marricio - 01.02.2011

Quote:
Originally Posted by .Com
Посмотреть сообщение
C:\Documents and Settings\Administrator.ZAP-SERVER\Desktop\Last server\gamemodes\lslrp.pwn(4235 : error 017: undefined symbol "SaveHandGun"
C:\Documents and Settings\Administrator.ZAP-SERVER\Desktop\Last server\gamemodes\lslrp.pwn(4235 : warning 215: expression has no effect
C:\Documents and Settings\Administrator.ZAP-SERVER\Desktop\Last server\gamemodes\lslrp.pwn(4235 : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Administrator.ZAP-SERVER\Desktop\Last server\gamemodes\lslrp.pwn(4235 : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator.ZAP-SERVER\Desktop\Last server\gamemodes\lslrp.pwn(4235 : fatal error 107: too many error messages on one

Код:
				    GetPlayerWeaponData(playerid, 2, SaveHandGun[playerid][0],SaveHandGun[playerid][1]);
This is all one line

and sorry admantis that I am still learning.
Thank you to the people that are helping me
https://sampwiki.blast.hk/wiki/GetPlayerWeaponData
Are you sure you are using this function correctly?


Re: How should I fix this? - admantis - 01.02.2011

Quote:
Originally Posted by .Com
Посмотреть сообщение
C:\Documents and Settings\Administrator.ZAP-SERVER\Desktop\Last server\gamemodes\lslrp.pwn(4235 : error 017: undefined symbol "SaveHandGun"
C:\Documents and Settings\Administrator.ZAP-SERVER\Desktop\Last server\gamemodes\lslrp.pwn(4235 : warning 215: expression has no effect
C:\Documents and Settings\Administrator.ZAP-SERVER\Desktop\Last server\gamemodes\lslrp.pwn(4235 : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Administrator.ZAP-SERVER\Desktop\Last server\gamemodes\lslrp.pwn(4235 : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator.ZAP-SERVER\Desktop\Last server\gamemodes\lslrp.pwn(4235 : fatal error 107: too many error messages on one

Код:
				    GetPlayerWeaponData(playerid, 2, SaveHandGun[playerid][0],SaveHandGun[playerid][1]);
This is all one line

and sorry admantis that I am still learning.
Thank you to the people that are helping me
Show me the line where the array SaveHandGun is defined
pawn Код:
new SaveHandGun[MAX_PLAYERS][sizeof(SaveHandGun)];
// or whatever you've got