xShocKz Posted January 8, 2012 Posted January 8, 2012 volevo sapere come aumentare la distanza per far attivare il carfade lo script pvo: function fadeCars() local you = getPedOccupiedVehicle(getLocalPlayer()) if you then youx, youy, youz = getElementPosition ( you ) else return end for i,v in ipairs(getElementsByType("player")) do local veh = getPedOccupiedVehicle(v) if (veh) and (you) then local othersx, othersy, othersz = getElementPosition ( veh ) if not (you == veh) then local distance = getDistanceBetweenPoints3D ( youx, youy, youz, othersx, othersy, othersz ) if (tonumber(distance) < 11) then smoothdistance = distance * 15 setElementAlpha ( veh, smoothdistance ) if not (getElementModel(veh) == 441 or getElementModel(veh) == 464 or getElementModel(veh) == 501 or getElementModel(veh) == 465 or getElementModel(veh) == 564 or getElementModel(veh) == 594) then setElementAlpha ( v, smoothdistance ) else setElementAlpha(v,0) end elseif (tonumber(distance) > 9) then setElementAlpha ( veh, 250 ) if not (getElementModel(veh) == 441 or getElementModel(veh) == 464 or getElementModel(veh) == 501 or getElementModel(veh) == 465 or getElementModel(veh) == 564 or getElementModel(veh) == 594) then setElementAlpha ( v,250) else setElementAlpha(v,0) end end end end end end bindKey("F4","down", function(key,state) if (key == "F4") and (state == "down") then if (carFadeOn == true) then carFadeOn = false removeEventHandler ( "onClientRender", getRootElement(), fadeCars ) for i,v in ipairs(getElementsByType("player")) do veh = getPedOccupiedVehicle(v) if (veh) then setElementAlpha ( veh, 255 ) if not (getElementModel(veh) == 441) or (getElementModel(veh) == 464) or (getElementModel(veh) == 501) or (getElementModel(veh) == 465) or (getElementModel(veh) == 564 or getElementModel(veh) == 594) then setElementAlpha (v,255) end end end outputChatBox(" #DB8181[CARFADE]: #0080FFCarfade #929292is #0080FFDisabled#929292!",255,140,0,true) else addEventHandler("onClientRender",getRootElement(),fadeCars) carFadeOn = true outputChatBox(" #DB8181[CARFADE]: #0080FFCarfade #929292is #0080FFEnabled#929292!",255,140,0,true) end end end) reply.
Giovanni94m Posted January 8, 2012 Posted January 8, 2012 Riga 14 if (tonumber(distance) < 11) then EDIT: controlla anche la riga 22
Paper Posted January 8, 2012 Posted January 8, 2012 Io ti consiglio di creare 2 variabili per le distanze, sarebbe più facile da modificare senza andare a cercare le linee, oppure crei i settings nel meta
HunT Posted January 8, 2012 Posted January 8, 2012 O mio dio il ritorno della merdaccia Sun!!!!!!!!!! ma che fine a fatto il tuo server? --------------------------------------------------------- shok (come ti ho detto in msn) cambia il numero della distanza come ti ha consigliato giovanni.
Paper Posted January 8, 2012 Posted January 8, 2012 O mio dio il ritorno della merdaccia Sun!!!!!!!!!!ma che fine a fatto il tuo server? Ti voglio bene anche io <3 Il mio server è stato chiuso qualche mesetto fa prima che abbandonassi mta, ma ora sono di nuovo qua e mi sto dedicando al mondo RP, ma prossimamente credo che aprirò anche un server race
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now