Locked vehicle - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Locked vehicle (
/showthread.php?tid=343281)
Locked vehicle -
a!DaN)_)-) - 17.05.2012
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)
Re: Locked vehicle -
Pizzy - 17.05.2012
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
Re: Locked vehicle -
a!DaN)_)-) - 17.05.2012
any idea on how to do this
id attempt it my self but only if i was certain .. which im not
Re: Locked vehicle -
a!DaN)_)-) - 17.05.2012
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
Re: Locked vehicle -
Jonny5 - 17.05.2012
show your code so we can help.
Re: Locked vehicle -
a!DaN)_)-) - 17.05.2012
Код:
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