A other moveobject/gate problem.
#1

Hello. I'm tryed a tutorial. but get 9 erros.

Code:
Код:
#include <a_samp>

#define COLOR_LIGHTBLUE 0x33CCFFAA

forward gateClose(playerid);

new hggate;

public OnFilterScriptInit()
{
print("\n--Parcare-RP by Dany\n");
CreateObject(988, 311.18411254883, -1785.8990478516, 3.5790901184082, 0, 0, 180);
CreateObject(3749, 339.02941894531, -1784.8265380859, 9.9355964660645, 0, 0, 0);
CreateObject(988, 316.59967041016, -1785.8944091797, 3.6663970947266, 0, 0, 179.99450683594);
CreateObject(988, 322.02551269531, -1785.9020996094, 3.7538070678711, 0, 0, 179.99450683594);
CreateObject(988, 327.44271850586, -1785.9958496094, 3.8406367301941, 0, 0, 179.99450683594);
CreateObject(988, 351.59762573242, -1786.0004882813, 4.3664393424988, 0, 0, 179.99450683594);
CreateObject(988, 357.04965209961, -1786.1511230469, 4.3798966407776, 0, 0, 179.99450683594);
CreateObject(988, 359.71328735352, -1788.7067871094, 4.2604808807373, 0, 0, 90);
CreateObject(988, 359.73754882813, -1794.2036132813, 3.9836025238037, 0, 0, 90);
CreateObject(988, 359.78540039063, -1799.6108398438, 3.8198194503784, 0, 0, 90);
CreateObject(988, 359.74838256836, -1804.99609375, 3.6619353294373, 0, 0, 90);
CreateObject(988, 359.73651123047, -1810.3354492188, 3.5054211616516, 0, 0, 90);
CreateObject(988, 359.79428100586, -1815.7497558594, 3.3506035804749, 0, 0, 90);
CreateObject(988, 357.17562866211, -1818.9221191406, 3.2587685585022, 0, 0, 9);
CreateObject(988, 351.83749389648, -1819.2946777344, 3.243935585022, 0, 0, 0);
CreateObject(988, 346.44354248047, -1819.3724365234, 3.2377052307129, 0, 0, 0);
CreateObject(988, 341.06805419922, -1819.3580322266, 3.2341890335083, 0, 0, 0);
CreateObject(988, 330.1291809082, -1819.5706787109, 3.2199392318726, 0, 0, 0);
CreateObject(988, 324.66296386719, -1819.7214355469, 3.2115154266357, 0, 0, 0);
CreateObject(988, 335.54614257813, -1819.4838867188, 3.2264523506165, 0, 0, 0);
CreateObject(988, 319.25024414063, -1819.5834960938, 3.2115893363953, 0, 0, 0);
CreateObject(988, 314.00979614258, -1819.7143554688, 3.203914642334, 0, 0, 0);
CreateObject(988, 308.58465576172, -1819.6737060547, 3.1947402954102, 0, 0, 0);
CreateObject(988, 305.79092407227, -1817.0220947266, 3.2789416313171, 0, 0, 270);
CreateObject(988, 305.8037109375, -1811.6083984375, 3.4178938865662, 0, 0, 270);
CreateObject(988, 305.78128051758, -1806.2507324219, 3.4414763450623, 0, 0, 270);
CreateObject(988, 305.89495849609, -1800.8201904297, 3.4651799201965, 0, 0, 270);
CreateObject(988, 305.77459716797, -1795.4763183594, 3.4775805473328, 0, 0, 270);
CreateObject(988, 305.63543701172, -1790.0384521484, 3.4880714416504, 0, 0, 270);
CreateObject(988, 307.51525878906, -1786.4649658203, 3.5156631469727, 0, 0, 30);
CreateObject(980, 339.02227783203, -1784.5198974609, 6.8551278114319, 0, 0, 0);
CreateObject(3749,316.01211548,-1785.01037598,9.54506397,0.00000000,0.00000000,0.00000000); //convertffs(1)
CreateObject(980,316.23278809,-1785.50659180,6.43586397,0.00000000,0.00000000,180.00000000); //convertffs(30)
CreateObject(3749,316.01211548,-1785.01037598,9.54506397,0.00000000,0.00000000,0.00000000); //convertffs(1)
hggate = CreateObject(980,316.23278809,-1785.50659180,6.43586397,0.00000000,0.00000000,180.00000000); //convertffs(30)
CreateObject(980,305.02368164,-1782.91711426,6.48429489,0.00000000,0.00000000,1.99453735); //convertffs(30)

return 1;
}


if(strcmp(cmdtext,"/opengate", true) == 0)
  {
   if (gTeam[playerid] == TEAM_GROVE)
   {                                               x          y         z    <- | - FOR THE RADIUS
		 if(PlayerToPoint(15.0, playerid,316.23278809,-1785.50659180))
		 {                                                              |
 	   MoveObject(hqgate, 305.02368164063, -1782.9171142578, 6.4842948913574, 1.500000);     <--opened
     return 1;          |         |             |           |           |       |
     }      REMEMBER THE NAME     x             y           z     Gate Speed
  }                                                                             |
}
                                                                                |
if(strcmp(cmdtext,"/closegate", true) == 0)
  {                                                                              \
   if (gTeam[playerid] == TEAM_GROVE)
   {                                                                               \
		 if(PlayerToPoint(15.0, playerid,283.2922,-1543.4369,24.7436))  ALL HERE THE SAME
		 {
 	   MoveObject(hggate, 316.23278809,-1785.50659180,6.43586397, 1.500000);     <--closed
     return 1;
     }
  }
}


return 0;
Erros:

Код:
C:\Users\me\Desktop\my-gate.pwn(56) : error 010: invalid function or declaration
C:\Users\me\Desktop\my-gate.pwn(58) : error 010: invalid function or declaration
C:\Users\me\Desktop\my-gate.pwn(60) : error 010: invalid function or declaration
C:\Users\me\Desktop\my-gate.pwn(63) : error 010: invalid function or declaration
C:\Users\me\Desktop\my-gate.pwn(68) : error 010: invalid function or declaration
C:\Users\me\Desktop\my-gate.pwn(70) : error 010: invalid function or declaration
C:\Users\me\Desktop\my-gate.pwn(72) : error 010: invalid function or declaration
C:\Users\me\Desktop\my-gate.pwn(75) : error 010: invalid function or declaration
C:\Users\me\Desktop\my-gate.pwn(81) : error 010: invalid function or declaration
C:\Users\me\Desktop\my-gate.pwn(49) : warning 204: symbol is assigned a value that is never used: "hggate"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


9 Errors.
Any know why i get the erro?
Reply
#2

Yea, Your Script is bad

Ill Show you how the first Command Should be.


Код:
if(strcmp("/closegate", cmdtext, true, 10) == 0)
	{
         if(PlayerToPoint(15.0, playerid,316.23278809,-1785.50659180))
		{
		 if (gTeam[playerid] == TEAM_GROVE)
 		{
		 	MoveObject(hqgate, 305.02368164063, -1782.9171142578, 6.4842948913574, 1.500000);
 			GameTextForPlayer(playerid, "Gate ~r~closing", 5000, 6);
 			new Float:pX, Float:pY, Float:pZ;
			PlayerPlaySound(playerid,1057,pX,pY,pZ);
   		}
    	return 1;
	}
At the top add new hqgate;
Reply
#3

You were using Variables / Definitions that are not defined.

By looking at your code, I think that this tutorial will help: https://sampwiki.blast.hk/wiki/PAWN_tutorial


Also, you must put the commands under OnPlayerCommandText.


Edit:

Looks like you are trying to create a gamemode. If that is the case, do NOT do it on this way. You must use OnGameModeInit, not OnFilterscriptInit.
Reply
#4

pawn Код:
#include <a_samp>

#define COLOR_LIGHTBLUE 0x33CCFFAA

forward gateClose(playerid);

new hggate;

public OnFilterScriptInit()
{
print("\n--Parcare-RP by Dany\n");
CreateObject(988, 311.18411254883, -1785.8990478516, 3.5790901184082, 0, 0, 180);
CreateObject(3749, 339.02941894531, -1784.8265380859, 9.9355964660645, 0, 0, 0);
CreateObject(988, 316.59967041016, -1785.8944091797, 3.6663970947266, 0, 0, 179.99450683594);
CreateObject(988, 322.02551269531, -1785.9020996094, 3.7538070678711, 0, 0, 179.99450683594);
CreateObject(988, 327.44271850586, -1785.9958496094, 3.8406367301941, 0, 0, 179.99450683594);
CreateObject(988, 351.59762573242, -1786.0004882813, 4.3664393424988, 0, 0, 179.99450683594);
CreateObject(988, 357.04965209961, -1786.1511230469, 4.3798966407776, 0, 0, 179.99450683594);
CreateObject(988, 359.71328735352, -1788.7067871094, 4.2604808807373, 0, 0, 90);
CreateObject(988, 359.73754882813, -1794.2036132813, 3.9836025238037, 0, 0, 90);
CreateObject(988, 359.78540039063, -1799.6108398438, 3.8198194503784, 0, 0, 90);
CreateObject(988, 359.74838256836, -1804.99609375, 3.6619353294373, 0, 0, 90);
CreateObject(988, 359.73651123047, -1810.3354492188, 3.5054211616516, 0, 0, 90);
CreateObject(988, 359.79428100586, -1815.7497558594, 3.3506035804749, 0, 0, 90);
CreateObject(988, 357.17562866211, -1818.9221191406, 3.2587685585022, 0, 0, 9);
CreateObject(988, 351.83749389648, -1819.2946777344, 3.243935585022, 0, 0, 0);
CreateObject(988, 346.44354248047, -1819.3724365234, 3.2377052307129, 0, 0, 0);
CreateObject(988, 341.06805419922, -1819.3580322266, 3.2341890335083, 0, 0, 0);
CreateObject(988, 330.1291809082, -1819.5706787109, 3.2199392318726, 0, 0, 0);
CreateObject(988, 324.66296386719, -1819.7214355469, 3.2115154266357, 0, 0, 0);
CreateObject(988, 335.54614257813, -1819.4838867188, 3.2264523506165, 0, 0, 0);
CreateObject(988, 319.25024414063, -1819.5834960938, 3.2115893363953, 0, 0, 0);
CreateObject(988, 314.00979614258, -1819.7143554688, 3.203914642334, 0, 0, 0);
CreateObject(988, 308.58465576172, -1819.6737060547, 3.1947402954102, 0, 0, 0);
CreateObject(988, 305.79092407227, -1817.0220947266, 3.2789416313171, 0, 0, 270);
CreateObject(988, 305.8037109375, -1811.6083984375, 3.4178938865662, 0, 0, 270);
CreateObject(988, 305.78128051758, -1806.2507324219, 3.4414763450623, 0, 0, 270);
CreateObject(988, 305.89495849609, -1800.8201904297, 3.4651799201965, 0, 0, 270);
CreateObject(988, 305.77459716797, -1795.4763183594, 3.4775805473328, 0, 0, 270);
CreateObject(988, 305.63543701172, -1790.0384521484, 3.4880714416504, 0, 0, 270);
CreateObject(988, 307.51525878906, -1786.4649658203, 3.5156631469727, 0, 0, 30);
CreateObject(980, 339.02227783203, -1784.5198974609, 6.8551278114319, 0, 0, 0);
CreateObject(3749,316.01211548,-1785.01037598,9.54506397,0.00000000,0.00000000,0.00000000); //convertffs(1)
CreateObject(980,316.23278809,-1785.50659180,6.43586397,0.00000000,0.00000000,180.00000000); //convertffs(30)
CreateObject(3749,316.01211548,-1785.01037598,9.54506397,0.00000000,0.00000000,0.00000000); //convertffs(1)
hggate = CreateObject(980,316.23278809,-1785.50659180,6.43586397,0.00000000,0.00000000,180.00000000); //convertffs(30)
CreateObject(980,305.02368164,-1782.91711426,6.48429489,0.00000000,0.00000000,1.99453735); //convertffs(30)

return 1;
}

public OnPlayerCommandText(playerid,cmdtext[])
{

if(strcmp(cmdtext,"/opengate", true) == 0)
  {
   if (gTeam[playerid] == TEAM_GROVE)
   {                                            
         if(PlayerToPoint(15.0, playerid,316.23278809,-1785.50659180))
         {                                                          
       MoveObject(hqgate, 305.02368164063, -1782.9171142578, 6.4842948913574, 1.500000);    
     }  
  }  
  return 1;                                                                            
}
                                                                               
if(strcmp(cmdtext,"/closegate", true) == 0)
  {                                                                              
   if (gTeam[playerid] == TEAM_GROVE)
   {                                                                              
         if(PlayerToPoint(15.0, playerid,283.2922,-1543.4369,24.7436))  ALL HERE THE SAME
         {
       MoveObject(hggate, 316.23278809,-1785.50659180,6.43586397, 1.500000);    
     }
  }
  return 1;
}


return 0;
}
I couldn't be bothered fixing your indenting sorry.
Reply
#5

Lol, I'm only making a gate in filterscript. And if my scripting is bad, is it the tutorial. I'm taked the code from the tutorial and added objects. Any know how to fix the erro
Reply
#6

Quote:
Originally Posted by Noner
Посмотреть сообщение
Lol, I'm only making a gate in filterscript. And if my scripting is bad, is it the tutorial. I'm taked the code from the tutorial and added objects. Any know how to fix the erro
Did you read what the tutorial said? Its there for a reason
Reply
#7

https://sampforum.blast.hk/showthread.php?tid=43930 <---- This one. Fixed it.
Reply
#8

This is the right code.

Код:
if(strcmp(cmdtext,"/opengate", true) == 0)
  {
   if (gTeam[playerid] == TEAM_GROVE)
   {
		 if(PlayerToPoint(15.0, playerid,283.2922,-1543.4369,24.7436))
		 {
 	   MoveObject(hqgate, 289.919067, -1547.427734, 27.193420, 1.500000);
     return 1;
     }
  }
}

if(strcmp(cmdtext,"/closegate", true) == 0)
  {
   if (gTeam[playerid] == TEAM_GROVE)
   {
		 if(PlayerToPoint(15.0, playerid,283.2922,-1543.4369,24.7436))
		 {
 	   MoveObject(hqgate, 283.870544, -1543.398804, 27.193420, 1.500000);
     return 1;
     }
  }
}
You just went in and had a Copy and Paste Free For All
Reply
#9

Код:
C:\Users\me\Desktop\my-gate.pwn(56) : error 010: invalid function or declaration
C:\Users\me\Desktop\my-gate.pwn(58) : error 010: invalid function or declaration
C:\Users\me\Desktop\my-gate.pwn(60) : error 010: invalid function or declaration
C:\Users\me\Desktop\my-gate.pwn(63) : error 010: invalid function or declaration
C:\Users\me\Desktop\my-gate.pwn(68) : error 010: invalid function or declaration
C:\Users\me\Desktop\my-gate.pwn(70) : error 010: invalid function or declaration
C:\Users\me\Desktop\my-gate.pwn(72) : error 010: invalid function or declaration
C:\Users\me\Desktop\my-gate.pwn(75) : error 010: invalid function or declaration
C:\Users\me\Desktop\my-gate.pwn(49) : warning 204: symbol is assigned a value that is never used: "hggate"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


8 Errors.
Hm.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)