/taze Errors
#1

After Several Several Minutes of working, I finished my /taze Command!


Buuut..... It wont work, I fixed several errors but i still have a few more.

Put this into your Pawno and compile it to see the errors i get.




Код:
	if(strcmp(cmd, "/taze", true) == 0)
	{
		if(IsPlayerConnected(playerid))
		{
     if(IsPlayerInAnyVehicle(playerid))
			  {
			    SendClientMessage(playerid, COLOR_RED, "You must step out the vehicle to use your tazer.");
			    return 1;
          }
     new suspect = GetClosestPlayer(playerid);
     if(IsPlayerConnected(suspect))
				{
        if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
        return 1;
				{
		 if(IsPlayerInAnyVehicle(suspect)
					  {
            SendClientMessage(playerid, COLOR_RED, "You cant taze that person, Becouse they are in a car.");
	          return 1;
					  }
     GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						new randt = random(4)+1;
						if(randt == 1)
						{
						  format(string, sizeof(string), "* %s shoots with his/her Tazer at %s, but missed.", sendername ,giveplayer);
							ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
						}
						else
						{
							format(string, sizeof(string), "* %s Hit you with a Tazer! ", sendername);
							SendClientMessage(suspect, COLOR_RED, string);
							format(string, sizeof(string), "* %s Will Not Be getting up for 20 Seconds! ", giveplayer);
							SendClientMessage(playerid, COLOR_RED, string);
							format(string, sizeof(string), "* %s shoots with his/her Tazer at %s and tazed him/her.", sendername ,giveplayer);
							ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
							GameTextForPlayer(suspect, "~r~Tazed", 2500, 3);
							TogglePlayerControllable(suspect, 0);
							LoopingAnim(suspect, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
							PlayerCuffed[suspect] = 1;
							PlayerCuffedTime[suspect] = 20;
						}
		      }
					else
					{
					  SendClientMessage(playerid, COLOR_RED, "  No one is near you to taze.");
					  return 1;

	  return 1;
	}

Reply
#2

Help please
Reply
#3

Post your errors
Reply
#4

Код:
C:\Documents and Settings\home\Desktop\samp02Xserver.win32\gamemodes\crazymix.pwn(112) : error 017: undefined symbol "cmd"
C:\Documents and Settings\home\Desktop\samp02Xserver.win32\gamemodes\crazymix.pwn(121) : error 017: undefined symbol "GetClosestPlayer"
C:\Documents and Settings\home\Desktop\samp02Xserver.win32\gamemodes\crazymix.pwn(124) : error 017: undefined symbol "GetDistanceBetweenPlayers"
C:\Documents and Settings\home\Desktop\samp02Xserver.win32\gamemodes\crazymix.pwn(128) : error 001: expected token: ")", but found "{"
C:\Documents and Settings\home\Desktop\samp02Xserver.win32\gamemodes\crazymix.pwn(132) : error 017: undefined symbol "giveplayer"
C:\Documents and Settings\home\Desktop\samp02Xserver.win32\gamemodes\crazymix.pwn(132) : error 017: undefined symbol "giveplayer"
C:\Documents and Settings\home\Desktop\samp02Xserver.win32\gamemodes\crazymix.pwn(132) : error 029: invalid expression, assumed zero
C:\Documents and Settings\home\Desktop\samp02Xserver.win32\gamemodes\crazymix.pwn(132) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


8 Errors.
Reply
#5

Post this in the GF topic..
Reply
#6

Quote:
Originally Posted by MenaceX^
Post this in the GF topic..
i did not get it off the God Father...Look good
i just copyed a bit off the god father.
Reply
#7

Hey, crazyscripter, Noxy here, took a look at your code, because i don't use Strtok i comverted it to strcmp, not tested, but there's no errors, apart from "undefined symbol" Errors ( I guess you have these )

Код:
if (strcmp("/taze", cmdtext, true, 5) == 0)
	{
		if(IsPlayerConnected(playerid))
		{
 			if(IsPlayerInAnyVehicle(playerid))
	  	{
   			SendClientMessage(playerid, COLOR_RED, "You must step out the vehicle to use your tazer.");
	    	return 1;
      	}
    		new suspect = GetClosestPlayer(playerid);
     	if(IsPlayerConnected(suspect))
			{
  				if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
				{
		 			if(IsPlayerInAnyVehicle(suspect))
		  		{
            SendClientMessage(playerid, COLOR_RED, "You cant taze that person, Becouse they are in a car.");
	          return 1;
				  }
     			GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
					GetPlayerName(playerid, sendername, sizeof(sendername));
					new randt = random(4)+1;
					if(randt == 1)
					{
	  				format(string, sizeof(string), "* %s shoots with his/her Tazer at %s, but missed.", sendername ,giveplayer);
						ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					}
					else
					{
						format(string, sizeof(string), "* %s Hit you with a Tazer! ", sendername);
						SendClientMessage(suspect, COLOR_RED, string);
						format(string, sizeof(string), "* %s Will Not Be getting up for 20 Seconds! ", giveplayer);
						SendClientMessage(playerid, COLOR_RED, string);
						format(string, sizeof(string), "* %s shoots with his/her Tazer at %s and tazed him/her.", sendername ,giveplayer);
						ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
						GameTextForPlayer(suspect, "~r~Tazed", 2500, 3);
						TogglePlayerControllable(suspect, 0);
						LoopingAnim(suspect, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
						PlayerCuffed[suspect] = 1;
						PlayerCuffedTime[suspect] = 20;
					}
   			}
				else
				{
  				SendClientMessage(playerid, COLOR_RED, "  No one is near you to taze.");
				  return 1;
				}
				return 1;
			}
		}
	}
Should work.
~NoxY
Reply
#8

just add ontop of ur script #include <uf>
or if u have that already get the ufefull functins include
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)