Can someone help me please?
#1

Can someone fix the warnings;
Код:
H:\Documents and Settings\Administrator\Desktop\SAMPSERVER\filterscripts\haven.pwn(123) : warning 217: loose indentation
H:\Documents and Settings\Administrator\Desktop\SAMPSERVER\filterscripts\haven.pwn(126) : warning 209: function "OnPlayerCommandText" should return a value
This is the script;
Код:
#include <a_samp>
#define FILTERSCRIPT
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_RED 0xFF0000AA
new ferrygate;

forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
forward SluitDeGatesVHaven();

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
  CreateObject(5147, 838.761169, -2180.064697, 10.762714, 0.0000, 0.0000, 270.0000);
	CreateObject(5147, 838.806213, -1955.347290, 10.781532, 0.0000, 0.0000, 90.0001);
	CreateObject(983, 825.544800, -2067.536621, 12.662110, 0.0000, 0.0000, 270.0000);
	CreateObject(983, 823.192505, -2067.562500, 12.662110, 0.0000, 0.0000, 270.0000);
	CreateObject(970, 850.846863, -2067.652588, 12.513626, 0.0000, 0.0000, 0.0000);
	CreateObject(10838, 830.506836, -1795.403564, 27.120302, 0.0000, 0.0000, 89.1405);
	CreateObject(8390, 839.174011, -2328.120117, 20.272165, 0.0000, 0.0000, 0.0000);
	CreateObject(973, 853.153870, -2258.459961, 0.707708, 0.0000, 0.0000, 180.0000);
	CreateObject(973, 852.908447, -2258.420654, 1.007708, 0.0000, 0.0000, 180.0000);
	CreateObject(973, 833.858948, -2278.184326, 1.135808, 0.0000, 0.0000, 0.0000);
	CreateObject(973, 835.279175, -2278.181885, 1.135808, 0.0000, 0.0000, 0.0000);
	CreateObject(973, 839.911011, -2282.749756, 1.185808, 0.0000, 0.0000, 270.0000);
	CreateObject(973, 839.912842, -2292.116699, 1.185810, 0.0000, 0.0000, 270.0000);
	CreateObject(973, 839.834229, -2301.382324, 1.135808, 0.0000, 0.0000, 270.0000);
	CreateObject(973, 839.826965, -2310.652832, 1.132708, 0.0000, 0.0000, 270.0000);
	CreateObject(973, 839.828247, -2319.889160, 1.132708, 0.0000, 0.0000, 270.0000);
	CreateObject(973, 839.837952, -2328.888916, 1.135810, 0.0000, 0.0000, 270.0000);
	CreateObject(973, 839.845642, -2337.984863, 1.135808, 0.0000, 0.0000, 270.0000);
	CreateObject(973, 839.874939, -2347.034668, 1.135808, 0.0000, 0.0000, 270.0000);
	CreateObject(973, 839.882507, -2356.385742, 1.135809, 0.0000, 0.0000, 270.0000);
	CreateObject(973, 839.908203, -2365.605469, 1.160809, 0.0000, 0.0000, 270.0000);
	CreateObject(973, 839.895569, -2373.411621, 1.160807, 0.0000, 0.0000, 270.0000);
	CreateObject(973, 835.232483, -2378.019531, 1.160807, 0.0000, 0.0000, 180.0000);
	CreateObject(973, 833.862610, -2377.990479, 1.157708, 0.0000, 0.0000, 180.0000);
	CreateObject(970, 831.203430, -2397.945557, 1.224858, 0.0000, 0.0000, 0.0000);
	CreateObject(970, 847.454102, -2397.950684, 1.243969, 0.0000, 0.0000, 0.0000);
	CreateObject(970, 843.339417, -2397.971924, 1.254553, 0.0000, 0.0000, 0.0000);
	CreateObject(970, 835.260925, -2397.932373, 1.195871, 0.0000, 0.0000, 0.0000);
	CreateObject(970, 841.363403, -2397.911377, 1.218969, 0.0000, 0.0000, 0.0000);
	CreateObject(3886, 838.263672, -2403.136719, 0.083357, 0.0000, 0.0000, 0.0000);
	CreateObject(3886, 838.278931, -2410.986816, 0.112543, 0.0000, 0.0000, 180.0000);
	CreateObject(16683, 849.260742, -1864.370483, 3.445165, 0.0000, 0.0000, 270.0000);
	CreateObject(10236, 850.060181, -2180.536621, 26.261620, 0.0000, 0.0000, 180.0001);
	CreateObject(2797, 838.875000, -2397.267334, 5.695754, 0.0000, 0.0000, 0.0000);
	CreateObject(9241, 862.696777, -2380.891602, 34.626297, 0.0000, 0.0000, 90.0000);
	CreateObject(6230, 844.142334, -2458.022217, -7.640540, 0.0000, 0.0000, 180.0000);
	CreateObject(3886, 838.287598, -2422.666992, 0.719908, 0.0000, 0.0000, 180.0000);
	CreateObject(1472, 838.524109, -2417.432129, 1.178155, 0.0000, 0.0000, 180.0000);
	CreateObject(1472, 837.045471, -2417.435791, 1.182383, 0.0000, 0.0000, 180.0000);
	CreateObject(1472, 839.586487, -2417.410645, 1.176147, 0.0000, 0.0000, 180.0000);
	CreateObject(3886, 838.302368, -2433.062012, 0.695337, 0.0000, 0.0000, 180.0000);
	CreateObject(3886, 838.268372, -2443.490234, 0.715121, 0.0000, 0.0000, 180.0000);
	CreateObject(3886, 838.275757, -2453.687500, 0.736690, 0.0000, 0.0000, 180.0000);
	CreateObject(3886, 838.286316, -2464.026367, 0.743697, 0.0000, 0.0000, 180.0000);
	CreateObject(3886, 838.279663, -2474.429932, 0.751717, 0.0000, 0.0000, 180.0000);
	CreateObject(3886, 838.289063, -2484.490967, 0.750439, 0.0000, 0.0000, 180.0000);
	CreateObject(3886, 838.270447, -2492.393311, 0.770435, 0.0000, 0.0000, 180.0000);
	CreateObject(6230, 844.130310, -2492.503906, -7.581972, 0.0000, 0.0000, 180.0001);
	CreateObject(3886, 838.279541, -2502.747803, 0.755227, 0.0000, 0.0000, 180.0000);
	CreateObject(3886, 838.280945, -2513.221191, 0.758596, 0.0000, 0.0000, 180.0000);
	CreateObject(3886, 838.269287, -2523.254883, 0.770373, 0.0000, 0.0000, 180.0000);
	CreateObject(6230, 832.274414, -2457.026855, -7.585258, 0.0000, 0.0000, 359.9999);
	CreateObject(6230, 832.366272, -2491.396973, -7.593969, 0.0000, 0.0000, 360.0000);
	ferrygate = CreateObject(982,838.593,-2258.364,1.626,0.0,0.0,-90.000);
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else


#endif

public OnGameModeInit()
{
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
  new Float:oldposx, Float:oldposy, Float:oldposz;
  new Float:tempposx, Float:tempposy, Float:tempposz;
  GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  tempposx = (oldposx -x);
  tempposy = (oldposy -y);
  tempposz = (oldposz -z);
  //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  {
    return 1;
  }
  return 0;
}

public OnPlayerCommandText(playerid, cmdtext[])
	if(strcmp(cmdtext,"/buyticket",true) == 0)
 	{
 	  new Playermoney = GetPlayerMoney(playerid);
	 	if (PlayerToPoint(3, playerid,838.7880,-2257.5159,1.9736)) // haven
  	  if (Playermoney >= 500)
 			{
			MoveObject(ferrygate,838.595,-2258.359,7.676, 4);
			GivePlayerMoney(playerid, -500);
			SendClientMessage(playerid, COLOR_YELLOW, "Welcome to Los Santos Ferry! You've payd $500");
			SetTimer("SluitDeGatesVHaven",5000,0);
  			}
			else
			{
			SendClientMessage(playerid, COLOR_RED, "You need a minimum of $500 to do this.");
			}
			return 1;
		}
		
public SluitDeGatesVHaven()
		{
			MoveObject(ferrygate,838.593,-2258.364,1.626, 4);
			return 1;
		}
I appreciate the help of whoever helps me.
Reply
#2

http://pastebin.com/m748934f0


I did a quick fix. Loose indentations is just code thats out of place. And you needed to add "return 1;" at the end of onplayercommandtext.
Reply
#3

Quote:
Originally Posted by Spanner~69
http://pastebin.com/m748934f0


I did a quick fix. Loose indentations is just code thats out of place. And you needed to add "return 1;" at the end of onplayercommandtext.
Let's Try It
It Works!
Thank you.
I will add you in the credits!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)