Would This Work?
#1

Hey Guys its me again im trying to make a sub by attaching a sub piece to a predator boat it attaches fine but i make the script to enter the boat and it fails the server says ERROR: Unknown Command here is the script

Код:
		if(strcmp(cmdtext,"/ESub",true) == 0)
		{
		    if(IsPlayerInRangeOfPoint(playerid, -1304.10, 336.30, 5.07))
		    {
      			PutPlayerInVehicle(playerid, SubBoat, 0);
      		}
		    return 1;
		}
If U Can Help Me +rep
Reply
#2

That code won't even compile! You dont' have the correct number of arguments for the IsPlayerInRangeOfPoint function: https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Reply
#3

No it wouldn't. You have no range for IsPlayerInRangeOfPoint

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Reply
#4

Won't.
IsPlayerInRangeOfPoint(playerid, -1304.10, 336.30, 5.07);
You are missing float: range. Template is: IsPlayerInRangeOfPoint(playerid,float:range,float: x,float:y,float:z).
replace it with this one:
PHP код:
IsPlayerInRangeOfPoint(playerid,10.0, -1304.10336.305.07
If you have defined SubBoat it should work
Reply
#5

oh thanks forgot that part
Reply
#6

Did you put it under OnPlayerCommandText ?
You used https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint wrong too.
Reply
#7

i know its sorted now but now the object wont attach to the boat

Код:

	SubBase = CreateObject(9958, -1296.66, 344.63, 6.33,   0.00, 0.00, 0.00);
	SubBoat = CreateVehicle(430, -1296.5679, 334.5663, 0.0000, 183.0000, -1, -1, 100);

	AttachObjectToVehicle(SubBase, SubBoat, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0);
Can U Help Me With This (i know im a pain xD)
Reply
#8

SubBase = CreateObject(9958, -1296.66, 344.63, 6.33, 0.00, 0.00, 0.00,//missing float:draw distance);
Reply
#9

still dont attach the object

thats what i need help with
Reply
#10

When did you define SubBoat and SubBase? Coz You should try:
PHP код:
new SubBase[MAX_PLAYERS],SubBoat[MAX_PLAYERS];
//replace all SubBoat to SubBoat[playerid] and SubBase to SubBase[playerid] 
if you are adding it when player enters the vehicle. If you are adding it OnGameModeInit() use
PHP код:
new SubBase[//number of boats],SubBase[//number of boats again]; 
and then while you are making them use
PHP код:
SubBoat[0] = 
SubBoat[1] = 
...
SubBase[0] = 
SubBase[1] = 
Then use
PHP код:
AttachObjectToVehicle(SubBase[0],SubBoat[0],...
AttachObjectToVehicle(SubBase[1],SubBoat[1],...
AttachObjectToVehicle(SubBase[2],SubBoat[2],...
... 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)