Locked vehicle
#1

Hey im just wondering how i can make it so if a players presses f and the car is locked it will send them a message saying this cars locked etc etc

i have a general idea but am not to sure just tell me what you need to make this ill give you the code for the car being locked
Код:
 if(playerVariables[x][pCarLock] == 1)
Reply
#2

You can make a vehicle loop, checks if the vehicle X,Y,Z is close to the player and check if it is locked.

- If vehicle is close (within 5 radius) and vehicle is locked, send a message
Reply
#3

any idea on how to do this
id attempt it my self but only if i was certain .. which im not
Reply
#4

Ive mabaged to do it but the only problem is it only is doing it for my private car i want it to do it for all cars
Reply
#5

show your code so we can help.
Reply
#6

Код:
if(IsKeyJustDown(KEY_SECONDARY_ATTACK, newkeys, oldkeys)) {
	    if(playerVariables[playerid][pTutorial] >= 5)
	        return firstPlayerSpawn(playerid);

        if(playerVariables[playerid][pTutorial] == 1) {
            playerVariables[playerid][pSkin] = GetPlayerSkin(playerid);

			SendClientMessage(playerid, COLOR_YELLOW, "Great. You've selected your clothes/skin.");

            playerVariables[playerid][pTutorial] = 2;

			ShowPlayerDialog(playerid, DIALOG_GENDER_SELECTION, DIALOG_STYLE_MSGBOX, "SERVER: Gender Selection", "What sex/gender is your character?", "Male", "Female");

            TextDrawHideForPlayer(playerid, textdrawVariables[2]);
			return 1;
		}
		foreach(Player, x) {
		new Float: vPos[4]; // x, y, z + z angle
		GetVehiclePos(GetPlayerVehicleID(playerid), vPos[0], vPos[1], vPos[2]);
		IsPlayerInRangeOfPoint(playerid,5,vPos[0], vPos[1], vPos[2]);
		if(playerVariables[x][pCarLock] == 1)
		{
		SendClientMessage(playerid,COLOR_RED,"This vehicle is locked!");
		}
		return 1;
		}
forget the tutorial shit its from the foreach(player part
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)