[Help] In the /roadblock command
#1

Actually, i add this to my script...

Код:
	if(strcmp(cmdtext, "/roadblock", true)==0)
  {
    	new Float:X, Float:Y, Float:Z, Float:A;
    	GetPlayerPos(playerid, X, Y, Z);
    	GetPlayerFacingAngle(playerid, A);
    	CreateObject(981, X, Y, Z, 0.0, 0.0, A);
    	SendClientMessage(playerid, COLOR_GREEN, "RoadBlock Successfully Deployed");
  	return 1;
  }
And this is the problem in "Pawn compiler"...

Код:
C:\Documents and Settings\аййм\щемзп дтбегд\ъйчйд згщд\Top Secret!\pawno\ъйчйд згщд\crp.pwn(1899) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Documents and Settings\аййм\щемзп дтбегд\ъйчйд згщд\Top Secret!\pawno\ъйчйд згщд\crp.pwn(1899) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Documents and Settings\аййм\щемзп дтбегд\ъйчйд згщд\Top Secret!\pawno\ъйчйд згщд\crp.pwn(1899) : warning 219: local variable "Z" shadows a variable at a preceding level
C:\Documents and Settings\аййм\щемзп дтбегд\ъйчйд згщд\Top Secret!\pawno\ъйчйд згщд\crp.pwn(1900) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\аййм\щемзп дтбегд\ъйчйд згщд\Top Secret!\pawno\ъйчйд згщд\crp.pwn(1902) : warning 213: tag mismatch
C:\Documents and Settings\аййм\щемзп дтбегд\ъйчйд згщд\Top Secret!\pawno\ъйчйд згщд\crp.pwn(1902) : warning 213: tag mismatch
C:\Documents and Settings\аййм\щемзп дтбегд\ъйчйд згщд\Top Secret!\pawno\ъйчйд згщд\crp.pwn(1902) : warning 213: tag mismatch
C:\Documents and Settings\аййм\щемзп дтбегд\ъйчйд згщд\Top Secret!\pawno\ъйчйд згщд\crp.pwn(1904) : warning 217: loose indentation
C:\Documents and Settings\аййм\щемзп дтбегд\ъйчйд згщд\Top Secret!\pawno\ъйчйд згщд\crp.pwn(1899) : warning 203: symbol is never used: "Z"
C:\Documents and Settings\аййм\щемзп дтбегд\ъйчйд згщд\Top Secret!\pawno\ъйчйд згщд\crp.pwn(1899) : warning 203: symbol is never used: "Y"
C:\Documents and Settings\аййм\щемзп дтбегд\ъйчйд згщд\Top Secret!\pawno\ъйчйд згщд\crp.pwn(1899) : warning 203: symbol is never used: "X"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
What i need to do to fix that problem?
Thanks!
Reply
#2

You are getting these errors because you have already defined X, Y and Z earlier in your script. Try this:

Код:
  if(strcmp(cmdtext, "/roadblock", true)==0)
  {
    	new Float:pX, Float:pY, Float:pZ, Float:pA;
    	GetPlayerPos(playerid, pX, pY, pZ);
    	GetPlayerFacingAngle(playerid, pA);
    	CreateObject(981, pX, pY, pZ, 0.0, 0.0, pA);
    	SendClientMessage(playerid, COLOR_GREEN, "RoadBlock Successfully Deployed");
  	return 1;
  }
X, Y and Z have been renamed to pX, pY and pZ. A has been changed to pA too just to match :P
Reply
#3

The errors were caused because there were already global variables named X Y Z
Reply
#4

C:\Users\zaynab account\Desktop\server\gamemodes\derby.pwn(283) : error 010: invalid function or declaration
C:\Users\zaynab account\Desktop\server\gamemodes\derby.pwn(286) : error 021: symbol already defined: "GetPlayerPos"
C:\Users\zaynab account\Desktop\server\gamemodes\derby.pwn(290) : error 010: invalid function or declaration
C:\Users\zaynab account\Desktop\server\gamemodes\derby.pwn(292) : warning 203: symbol is never used: "pA"
C:\Users\zaynab account\Desktop\server\gamemodes\derby.pwn(292) : warning 203: symbol is never used: "pX"
C:\Users\zaynab account\Desktop\server\gamemodes\derby.pwn(292) : warning 203: symbol is never used: "pY"
C:\Users\zaynab account\Desktop\server\gamemodes\derby.pwn(292) : warning 203: symbol is never used: "pZ"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.


erros help
Reply
#5

Then you din't copied this
Код:
  if(strcmp(cmdtext, "/roadblock", true)==0)
  {
    	new Float:pX, Float:pY, Float:pZ, Float:pA;
    	GetPlayerPos(playerid, pX, pY, pZ);
    	GetPlayerFacingAngle(playerid, pA);
    	CreateObject(981, pX, pY, pZ, 0.0, 0.0, pA);
    	SendClientMessage(playerid, COLOR_GREEN, "RoadBlock Successfully Deployed");
  	return 1;
  }
You just added p to your X Y and Z but only in one line or maybe u skipped one line by mistake
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)