Please help with PlayerToPoint
#1

help me please i got thees errors i try to fix them like 4 hours but i dunno how to fix them. I am noob at scripting....just mapper so i want make with some easy think cooler map! so the errors!

Quote:

(116) : error 029: invalid expression, assumed zero
(116) : error 017: undefined symbol "PlayerToPoint"
(116) : error 029: invalid expression, assumed zero
(116) : fatal error 107: too many error messages on one line

guess you will need my script!

so here will be.
Quote:

/*
Credits: Mr.Rams Email-kasis223@inbox.lv
Over Street Rest Place
*/

new lift;

#include <a_samp>
public OnFilterScriptInit()
{
CreateObject(8650, 1455.0733642578, -1426.4523925781, 23.075296401978, 0.000000, 90, 270); //
CreateObject(8652, 1459.5125732422, -1427.4174804688, 24.313241958618, 0.000000, 0.000000, 0.000000); //
CreateObject(8650, 1455.0733642578, -1424.3637695313, 23.075296401978, 0.000000, 90, 90); //
CreateObject(8650, 1455.0733642578, -1422.1486816406, 23.075296401978, 0.000000, 90, 90); //
CreateObject(1649, 1445.8024902344, -1427.4213867188, 26.121486663818, 0.000000, 0.000000, 0.000000); //
CreateObject(1649, 1450.1903076172, -1427.4213867188, 26.121486663818, 0.000000, 0.000000, 0.000000); //
CreateObject(1649, 1454.5726318359, -1427.4213867188, 26.121486663818, 0.000000, 0.000000, 0.000000); //
CreateObject(1649, 1458.9750976563, -1427.4213867188, 26.121486663818, 0.000000, 0.000000, 0.000000); //
CreateObject(1649, 1463.3402099609, -1427.4213867188, 26.121486663818, 0.000000, 0.000000, 0.000000); //
CreateObject(1649, 1467.6519775391, -1427.4213867188, 26.121486663818, 0.000000, 0.000000, 0.000000); //
CreateObject(1215, 1452.3928222656, -1427.5745849609, 25.240224838257, 0.000000, 0.000000, 0.000000); //
CreateObject(1215, 1444.7578125, -1427.4713134766, 25.240224838257, 0.000000, 0.000000, 0.000000); //
CreateObject(1215, 1460.1351318359, -1427.5385742188, 25.240224838257, 0.000000, 0.000000, 0.000000); //
CreateObject(1215, 1466.7381591797, -1427.4783935547, 25.020067214966, 0.000000, 0.000000, 0.000000); //
CreateObject(8652, 1459.8681640625, -1421.349609375, 24.213241577148, 0.000000, 0.000000, 0.000000); //
CreateObject(1215, 1445.0458984375, -1421.1033935547, 25.140224456787, 0.000000, 0.000000, 0.000000); //
CreateObject(1215, 1452.76171875, -1421.0805664063, 25.140224456787, 0.000000, 0.000000, 0.000000); //
CreateObject(1215, 1460.4681396484, -1421.0769042969, 25.140224456787, 0.000000, 0.000000, 0.000000); //
CreateObject(1649, 1450.6025390625, -1421.2646484375, 26.021486282349, 0.000000, 0.000000, 179.99450683594); //
CreateObject(1649, 1454.9559326172, -1421.2655029297, 26.021486282349, 0.000000, 0.000000, 179.99450683594); //
CreateObject(1649, 1459.2457275391, -1421.2655029297, 26.021486282349, 0.000000, 0.000000, 179.99450683594); //
CreateObject(1649, 1463.6359863281, -1421.2655029297, 26.022485733032, 0.000000, 0.000000, 179.99450683594); //
CreateObject(1649, 1450.2707519531, -1427.4213867188, 26.121486663818, 0.000000, 0.000000, 179.99450683594); //
CreateObject(1649, 1445.8961181641, -1427.4213867188, 26.121486663818, 0.000000, 0.000000, 179.99450683594); //
CreateObject(1649, 1454.6064453125, -1427.4213867188, 26.121486663818, 0.000000, 0.000000, 179.99450683594); //
CreateObject(1649, 1458.8989257813, -1427.4213867188, 26.121486663818, 0.000000, 0.000000, 179.99450683594); //
CreateObject(1649, 1463.2194824219, -1427.4213867188, 26.121486663818, 0.000000, 0.000000, 179.99450683594); //
CreateObject(1649, 1467.6519775391, -1427.4213867188, 26.121486663818, 0.000000, 0.000000, 179.99450683594); //
CreateObject(1649, 1450.6284179688, -1421.2655029297, 26.021486282349, 0.000000, 0.000000, 0.000000); //
CreateObject(1649, 1455.0275878906, -1421.2655029297, 26.021486282349, 0.000000, 0.000000, 0.000000); //
CreateObject(1649, 1459.3774414063, -1421.2655029297, 26.021486282349, 0.000000, 0.000000, 0.000000); //
CreateObject(1649, 1463.7189941406, -1421.2655029297, 26.021486282349, 0.000000, 0.000000, 0.000000); //
CreateObject(9131, 1445.5018310547, -1421.0317382813, 22.807355880737, 0.000000, 0.000000, 0.000000); //
CreateObject(9131, 1448.3326416016, -1421.0317382813, 22.807355880737, 0.000000, 0.000000, 0.000000); //
CreateObject(1649, 1446.865234375, -1421.03125, 20.527282714844, 0.000000, 90, 179.99450683594); //
CreateObject(9131, 1448.3326416016, -1421.0317382813, 20.698278427124, 0.000000, 0.000000, 0.000000); //
CreateObject(9131, 1448.3326416016, -1421.0317382813, 18.575634002686, 0.000000, 0.000000, 0.000000); //
CreateObject(9131, 1448.33203125, -1421.03125, 16.325634002686, 0.000000, 0.000000, 0.000000); //
CreateObject(9131, 1448.33203125, -1421.03125, 14.325634002686, 0.000000, 0.000000, 0.000000); //
CreateObject(9131, 1448.33203125, -1421.03125, 12.325634002686, 0.000000, 0.000000, 0.000000); //
CreateObject(1649, 1446.865234375, -1421.03125, 16.277282714844, 0.000000, 90, 179.99450683594); //
CreateObject(1649, 1446.865234375, -1421.03125, 12.027282714844, 0.000000, 90, 179.99450683594); //
CreateObject(9131, 1445.5009765625, -1421.03125, 20.807355880737, 0.000000, 0.000000, 0.000000); //
CreateObject(9131, 1445.5009765625, -1421.03125, 18.807355880737, 0.000000, 0.000000, 0.000000); //
CreateObject(9131, 1445.5009765625, -1421.03125, 16.807355880737, 0.000000, 0.000000, 0.000000); //
CreateObject(9131, 1445.5009765625, -1421.03125, 14.807355880737, 0.000000, 0.000000, 0.000000); //
CreateObject(9131, 1445.5009765625, -1421.03125, 12.807355880737, 0.000000, 0.000000, 0.000000); //
lift = CreateObject(2987, 1446.90234375, -1420.13671875, 12.489845275879, 90, 0.000000, 270); //
CreateObject(9131, 1448.3419189453, -1419.1374511719, 13.673492431641, 0.000000, 0.000000, 0.000000); //
CreateObject(9131, 1448.341796875, -1419.13671875, 15.923492431641, 0.000000, 0.000000, 0.000000); //
CreateObject(9131, 1448.341796875, -1419.13671875, 17.923492431641, 0.000000, 0.000000, 0.000000); //
CreateObject(9131, 1448.341796875, -1419.13671875, 19.923492431641, 0.000000, 0.000000, 0.000000); //
CreateObject(9131, 1448.341796875, -1419.13671875, 21.923492431641, 0.000000, 0.000000, 0.000000); //
CreateObject(9131, 1448.341796875, -1419.13671875, 23.923492431641, 0.000000, 0.000000, 0.000000); //
CreateObject(9131, 1445.4791259766, -1419.3095703125, 13.670059204102, 0.000000, 0.000000, 0.000000); //
CreateObject(9131, 1445.478515625, -1419.3095703125, 15.670059204102, 0.000000, 0.000000, 0.000000); //
CreateObject(9131, 1445.478515625, -1419.3095703125, 17.670059204102, 0.000000, 0.000000, 0.000000); //
CreateObject(9131, 1445.478515625, -1419.3095703125, 19.920059204102, 0.000000, 0.000000, 0.000000); //
CreateObject(9131, 1445.478515625, -1419.3095703125, 21.920059204102, 0.000000, 0.000000, 0.000000); //
CreateObject(9131, 1445.478515625, -1419.3095703125, 23.920059204102, 0.000000, 0.000000, 0.000000); //
CreateObject(2909, 1448.5908203125, -1420.0632324219, 16.100622177124, 90, 0.000000, 0.000000); //
CreateObject(2909, 1448.5908203125, -1420.0625, 20.100622177124, 90, 0.000000, 0.000000); //
CreateObject(2909, 1445.3444824219, -1420.2390136719, 15.600622177124, 90, 0.000000, 0.000000); //
CreateObject(2909, 1445.34375, -1420.23828125, 20.100622177124, 90, 0.000000, 0.000000); //
CreateObject(1649, 1446.865234375, -1421.03125, 20.527282714844, 0.000000, 90, 0.000000); //
CreateObject(1649, 1446.865234375, -1421.03125, 16.277282714844, 0.000000, 90, 0.000000); //
CreateObject(1649, 1446.865234375, -1421.03125, 11.777282714844, 0.000000, 90, 0.000000); //
CreateObject(1698, 1446.7221679688, -1422.7125244141, 23.590894699097, 0.000000, 0.000000, 270.3151855468; //
CreateObject(1698, 1446.7403564453, -1422.4134521484, 23.835115432739, 0.000000, 0.000000, 270.31311035156); //
CreateObject(1698, 1446.7248535156, -1422.0285644531, 24.079336166382, 0.000000, 0.000000, 270.31311035156); //
CreateObject(9131, 1447.6328125, -1419.1596679688, 24.618911743164, 0.000000, 90, 0.000000); //
CreateObject(9131, 1446.1121826172, -1419.154296875, 24.618911743164, 0.000000, 90, 0.000000); //
CreateObject(1649, 1446.7258300781, -1419.1651611328, 22.45685005188, 0.000000, 90, 0.000000); //
CreateObject(1649, 1446.7255859375, -1419.1650390625, 18.20685005188, 0.000000, 90, 0.000000); //
CreateObject(1649, 1446.7255859375, -1419.1650390625, 22.45685005188, 0.000000, 90, 180); //
CreateObject(1649, 1446.7255859375, -1419.1650390625, 18.20685005188, 0.000000, 90, 179.99450683594); //
CreateObject(1688, 1446.8303222656, -1418.0688476563, 24.399017333984, 270, 0.000000, 0.000000); //
CreateObject(642, 1455.3127441406, -1423.1262207031, 24.895534515381, 0.000000, 0.000000, 0.000000); //
CreateObject(1319, 1448.6843261719, -1421.0770263672, 24.902618408203, 0.000000, 0.000000, 0.000000); //
CreateObject(1319, 1448.5709228516, -1420.7333984375, 24.49831199646, 0.000000, 0.000000, 0.000000); //
CreateObject(1319, 1445.4802246094, -1419.2801513672, 25.611015319824, 0.000000, 0.000000, 0.000000); //
CreateObject(1319, 1446.4331054688, -1419.2713623047, 25.544387817383, 0.000000, 0.000000, 0.000000); //
CreateObject(1319, 1447.5008544922, -1419.2730712891, 25.544387817383, 0.000000, 0.000000, 0.000000); //
CreateObject(1319, 1448.396484375, -1419.2580566406, 25.614448547363, 0.000000, 0.000000, 0.000000); //
CreateObject(1319, 1448.5703125, -1420.1334228516, 24.49831199646, 0.000000, 0.000000, 0.000000); //
CreateObject(1319, 1448.5703125, -1419.7327880859, 24.49831199646, 0.000000, 0.000000, 0.000000); //
CreateObject(1724, 1455.6594238281, -1422.6977539063, 23.472305297852, 0.000000, 0.000000, 344.1201171875); //
CreateObject(1724, 1454, -1423.1800537109, 23.472305297852, 0.000000, 0.000000, 27.78894042968; //
CreateObject(2837, 1455.3494873047, -1423.9248046875, 23.972305297852, 0.000000, 0.000000, 0.000000); //
CreateObject(1827, 1455.3634033203, -1424.2514648438, 23.472305297852, 0.000000, 0.000000, 0.000000); //
CreateObject(1432, 1462.4467773438, -1423.1695556641, 23.472305297852, 0.000000, 0.000000, 0.000000); //
CreateObject(1432, 1459.8616943359, -1423.078125, 23.472305297852, 0.000000, 0.000000, 306.18005371094); //
CreateObject(625, 1450.8668212891, -1422.5578613281, 23.972305297852, 0.000000, 0.000000, 0.000000); //
CreateObject(630, 1457.201171875, -1422.9691162109, 24.497463226318, 0.000000, 0.000000, 0.000000); //
CreateObject(1215, 1448.41015625, -1418.5184326172, 13.108799934387, 0.000000, 0.000000, 0.000000); //
CreateObject(1215, 1445.4669189453, -1418.5748291016, 13.10528755188, 0.000000, 0.000000, 0.000000); //
CreateObject(1340, 1462.3332519531, -1425.6080322266, 24.599891662598, 0.000000, 0.000000, 140.66055297852); //

}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/liftdown", cmdtext, true, 10) == 0) && PlayerToPoint(5 ,playerid, Float: X,Float: Y,Float: Z))
{
if(PlayerToPoint(5, playerid, 1446.90234375, -1420.13671875, 12.48984527))
{
MoveObject(lift, 1446.90234375, -1420.13671875, 12.48984527, 1.50);//
return 1;
}

{
if (strcmp("/liftup", cmdtext, true, 10) == 0) && PlayerToPoint(5 ,playerid, Float: X,Float: Y,Float: Z))
{
if(PlayerToPoint(5, playerid, 1446.90234375, -1420.13671875, 23.98984527))
{
MoveObject(lift, 1446.90234375, -1420.13671875, 23.98984527, 1.50);//
return 1;
}
return 0;
}

public PlayerToPoint(Float:radi, playerid, Float, Float:y, Float:z)
{
if(IsPlayerConnected(playerid))
{
new Floatldposx, Floatldposy, Floatldposz;
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;
}

Please help!
Reply
#2

Shrink (press) ctrl+z and back on start somewhere you miss the bracket or comma/point/colon/semicolon,careful look and correct.

if you don't have put in
Код:
new lift;
This throws
Код:
 lift = CreateObject(2987, 1446.90234375, -1420.13671875, 12.489845275879, 90, 0.000000, 270); //
if you insert Objects in Gamemod then in "OnGameMod" like this
Код:
public OnGameModeInit()
{
	new string[MAX_PLAYER_NAME];
  new string1[MAX_PLAYER_NAME];
	for(new c=0;c<CAR_AMOUNT;c++)
	{
		Gas[c] = GasMax;
	}
	Fbikapija = CreateObject(976, -1974.1923828125, 1321.4313964844, 6.2821254730225, 0, 0, 179.6494140625); // FBI
put movable fence

and Other Objects down "AddStaticPickup" my recommendation


and if you don't have you must have
Код:
//------------------PDlift---------------------------

	if(strcmp(cmd,"/PDgore",true)==0)
	{
	  if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
	  {
			MoveObject(PDlift, -1633.8805, 683.7799, 48.6289,3.000);
			SendClientMessage(playerid, COLOR_GREEN, "Dizete lift PD-a.");
		}
		else
		{
			SendClientMessage(playerid, COLOR_RED, " Nisi clan PD-a.");
		}
		return 1;
	}
	if(strcmp(cmd,"/PDdole",true)==0)
	{
	  if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
	  {
			MoveObject(PDlift, -1636.0908,682.8247,6.1875,3.000);

			SendClientMessage(playerid, COLOR_GREEN, "Spustate lift PD-a.");
		}
		else
		{
			SendClientMessage(playerid, COLOR_GREEN, "Nisi clan PD-a.");
		}
		return 1;
 }
Reply
#3

well what i want do it is...
idea when you enter on lift then only command work /liftup or /liftdown... like you are range of lift!
Reply
#4

okay i will do this to you

throw in:
Код:
new lift
than down "OnGameModInt"

Код:
lift = CreateObject(2987, 1446.90234375, -1420.13671875, 12.489845275879, 90, 0.000000, 270); // write here for what is Lift
then you must do how to open and how to close, throw down "OnPlayerCommandText" this
Код:
//------------------PDlift---------------------------

	if(strcmp(cmd,"/PDup",true)==0)
	{
	  if(PlayerInfo[playerid][pMember] == number of organisation||PlayerInfo[playerid][pLeader] == number of organisation)
	  {
			MoveObject(lift, -1633.8805, 683.7799, 48.6289,3.000);
			SendClientMessage(playerid, COLOR_GREEN, "Rising lift of PD.");
		}
		else
		{
			SendClientMessage(playerid, COLOR_RED, " You are not PD-a.");
		}
		return 1;
	}
	if(strcmp(cmd,"/PDdown",true)==0)
	{
	  if(PlayerInfo[playerid][pMember] == number of organisation||PlayerInfo[playerid][pLeader] == number of organisation)
	  {
			MoveObject(lift, -1636.0908,682.8247,6.1875,3.000);

			SendClientMessage(playerid, COLOR_GREEN, "Downhill of lift PD.");
		}
		else
		{
			SendClientMessage(playerid, COLOR_GREEN, "You are not PD.");
		}
		return 1;
 }
if you want to move that Lift you must make axis Z minus or plus

for removable fencing read tutorial
x y z
(2987, 1446.90234375, -1420.13671875, 12.489845275879, 90, 0.000000, 270); //

I think I have helped you! good luck!
Reply
#5

well lift is working...but everybody can do it. i want do that command /liftup and /liftdown work in radius.
Reply
#6

Use IsPlayerInRangeOfPoint.
Reply
#7

try this
pawn Код:
if(strcmp(cmd,"/PDup",true)==0)
    {
      if(PlayerInfo[playerid][pMember] == number of organisation||PlayerInfo[playerid][pLeader] == number of organisation)
      {
            MoveObject(lift, -1633.8805, 683.7799, 48.6289,3.000);
            if(!PlayerToPoint(5, playerid, 1446.90234375, -1420.13671875, 23.98984527))return SendClientMessage(playerid, COLOR_RED, "You Must be near The Lift to use this command.");
            SendClientMessage(playerid, COLOR_GREEN, "Rising lift of PD.");
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, " You are not PD-a.");
        }
        return 1;
    }
    if(strcmp(cmd,"/PDdown",true)==0)
    {
      if(PlayerInfo[playerid][pMember] == number of organisation||PlayerInfo[playerid][pLeader] == number of organisation)
      {
            MoveObject(lift, -1636.0908,682.8247,6.1875,3.000);
            if(!PlayerToPoint(5, playerid, 1446.90234375, -1420.13671875, 12.48984527))return SendClientMessage(playerid, COLOR_RED, "You Must be near The Lift to use this command.");
            SendClientMessage(playerid, COLOR_GREEN, "Downhill of lift PD.");
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREEN, "You are not PD.");
        }
        return 1;
 }
Reply
#8

no i got like this error
Quote:

compound statement not closed at the end of file (started at line 125)

can anybody fix this...

Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/liftdown", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, 1446.90234375, -1420.13671875, 12.48984527))
{
MoveObject(lift, 1446.90234375, -1420.13671875, 12.48984527, 1.50);//
return 1;
}
{
if (strcmp("/liftup", cmdtext, true, 10) == 0)//line 125
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, 1446.90234375, -1420.13671875, 23.98984527))
{
MoveObject(lift, 1446.90234375, -1420.13671875, 23.98984527, 1.50);//
return 1;
}
return 0;
}
Reply
#9

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp("/liftdown", cmdtext, true, 10) == 0)
	{
		if(IsPlayerInRangeOfPoint(playerid, 5.0, 1446.90234375, -1420.13671875, 12.48984527))
		{
			MoveObject(lift, 1446.90234375, -1420.13671875, 12.48984527, 1.50);//
		}
		return 1;
	}

	if (strcmp("/liftup", cmdtext, true, 10) == 0)//line 125
	{
		if(IsPlayerInRangeOfPoint(playerid, 5.0, 1446.90234375, -1420.13671875, 23.98984527))
		{
			MoveObject(lift, 1446.90234375, -1420.13671875, 23.98984527, 1.50);//
		}
		return 1;
	}
	return 0;
}
Reply
#10

wohooo!!!!
Thanks you -> DJDhan

Cokie to you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)