Need help with personal car system!
#1

I have one personal car system but whenever i use /vfind [ID] it says this is not your personal vehicle. help!

Code:
Код:
CMD:vfind(playerid, params[])
{
	new vid, Float:A, Float:B, Float:C, qid = GetVehicleID(vid);
	//--------------------------------------------------------------------------
	if(sscanf(params, "i", vid)) return
	SendUsage(playerid, "/vFind [CarID]");
	//--------------------------------------------------------------------------
    if(strcmp(VehicleOwner[vid], PlayerName(playerid), false))
	return SendError(playerid, "This car isn't yours!");
	//--------------------------------------------------------------------------
	if(GetPlayerVehicleAccess(playerid, qid) < 2 && !IsPlayerAdmin(playerid)) return
	SendError(playerid, "This is not your personal vehicle(1).");
	//--------------------------------------------------------------------------
	if(!IsValidVehicle(qid) && !IsPlayerAdmin(playerid)) return
	SendError(playerid, "This is not your personal vehicle(2).");
	//--------------------------------------------------------------------------
  	return GetVehiclePos(vid, A,B,C), vFindCar[playerid] = 1, PutPlayerInVehicle(playerid, vid, 0), SendClientMessage(playerid, ~1, "You have been teleported to your personal car");
}
Reply
#2

Hi. Removing this !IsPlayerAdmin(playerid) might help. Please try.
Reply
#3

Tried already but it does nothing...
Reply
#4

Show us GetPlayerVehicleAccess. Something is wrong there.
Reply
#5

Quote:
Originally Posted by GTLS
Посмотреть сообщение
Show us GetPlayerVehicleAccess. Something is wrong there.
Here is the code:
Код:
GetPlayerVehicleAccess(playerid, vehicleid)
{
	if(IsValidVehicle(vehicleid))
	{
		if(VehicleCreated[vehicleid] == VEHICLE_DEALERSHIP)
		{
			if(!IsPlayerAdmin(playerid))
			{
				return 1;
			}
		}
		else if(VehicleCreated[vehicleid] == VEHICLE_PLAYER)
		{
			if(strcmp(VehicleOwner[vehicleid], PlayerName(playerid)) == 0)
			{
				return 2;
			}
		}
	}
	else
	{
		return 1;
	}
	return 0;
}
Reply
#6

What is wrong with that?
Reply
#7

You dont have to use qid. vid will work fine.

Second, why do you want to GetVehiclePos when you do nothing with it. You can put someone inside a car without even getting the position.

PHP код:
 if(GetPlayerVehicleAccess(playeridqid) < && !IsPlayerAdmin(playerid)) //This 
if(GetPlayerVehicleAccess(playeridqid) != && !IsPlayerAdmin(playerid)) //Should be like this 
In the ErrorMessage, which one does it get called, (1) or (2)

EDIT: Dont do double posting.
Reply
#8

I am newbie at scripting, can u please help me in replacing (qid) with (vid) ?
Reply
#9

Quote:
Originally Posted by NavedAkhter
Посмотреть сообщение
I am newbie at scripting, can u please help me in replacing (qid) with (vid) ?
You might be new in scripting but you can read right? Just replace qid in your command with vid. How hard is it?
Reply
#10

Quote:
Originally Posted by GTLS
Посмотреть сообщение
You might be new in scripting but you can read right? Just replace qid in your command with vid. How hard is it?
Done! But its not working

ERROR: This is not your personal vehicle (1).
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)