Car Breakin
#1

Код:
CMD:carbreakin(playerid, params[])
{
    new Float: vX, Float: vY, Float: vZ;
   	for(new i=0; i<MAX_VEHICLES; i++)
	{
		GetVehiclePos(i, vX, vY, vZ);
		{
  			if(IsPlayerInRangeOfPoint(playerid, 10.0, vX, vY, vZ))
    		{
        		SendClientMessage(playerid, COLOR_LIGHTRED, "You're near a car and the breakin bit needs adding");
    		}
    		else return SendClientMessage(playerid, COLOR_LIGHTRED, "You're near to car!");
		}
	}
	return 1;
}
So I'm trying to get this to work, so that I can allow the player to break into locked vehicles, currently it just says you are not near to the car even when you're in distance of one :/
Reply
#2

Код:
CMD:carbreakin(playerid, params[])
{
	new 
		Float: vX, 
		Float: vY,
		Float: vZ
	;

   	for(new i = 0; i != MAX_VEHICLES; i++)
	{
		if (!IsValidVehicle(vehicleid))
			continue;

		GetVehiclePos(i, vX, vY, vZ);

  		if(IsPlayerInRangeOfPoint(playerid, 10.0, vX, vY, vZ))
    	{
        	SendClientMessage(playerid, COLOR_LIGHTRED, "You're near a car and the breakin bit needs adding");
        	break;
    	}
    	else 
    	{
    		SendClientMessage(playerid, COLOR_LIGHTRED, "You're not near to car!");
    	}
	}
	return 1;
}
Reply
#3

Quote:
Originally Posted by Ralfie
Посмотреть сообщение
Код:
CMD:carbreakin(playerid, params[])
{
	new 
		Float: vX, 
		Float: vY,
		Float: vZ
	;

   	for(new i = 0; i != MAX_VEHICLES; i++)
	{
		if (!IsValidVehicle(vehicleid))
			continue;

		GetVehiclePos(i, vX, vY, vZ);

  		if(IsPlayerInRangeOfPoint(playerid, 10.0, vX, vY, vZ))
    	{
        	SendClientMessage(playerid, COLOR_LIGHTRED, "You're near a car and the breakin bit needs adding");
        	break;
    	}
    	else 
    	{
    		SendClientMessage(playerid, COLOR_LIGHTRED, "You're not near to car!");
    	}
	}
	return 1;
}
Will give it a try, sec.

Код:
C:\Users\Nathan\Desktop\Downtown Roleplay\gamemodes\core.pwn(2108) : error 017: undefined symbol "IsValidVehicle"
C:\Users\Nathan\Desktop\Downtown Roleplay\gamemodes\core.pwn(2108) : error 017: undefined symbol "vehicleid"
C:\Users\Nathan\Desktop\Downtown Roleplay\gamemodes\core.pwn(2108) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Downtown Roleplay\gamemodes\core.pwn(2108) : fatal error 107: too many error messages on one line
Reply
#4

Any fix?
Reply
#5

Nevermind, I got a error about vehicleid to i replaced it to 'i' and then it just spits out like 50 lines saying im not near a vehicle..

Код:
C:\Users\Nathan\Desktop\Downtown Roleplay\gamemodes\core.pwn(2130) : error 017: undefined symbol "vehicleid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#6

new vehicleid;
Reply
#7

Quote:
Originally Posted by Scrillex
Посмотреть сообщение
new vehicleid;
this is checking all vehicles, not one
Reply
#8

new vehicleid = GetPlayerVehicleID(playerid);
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)