Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: kolczatka
1. Kolczatka
Dobry,
Jak napisa? skrypt na kolczatk?? Tak aby tylko np. frakcja z elementdat? SAPD j? mia?a nie pod komende, tylko pod np X a pod Z aby usuwa?o kolczatk?? Pys 3.0
2. Kolczatka
witam, mam problem z kolczatk?, w takim sensie ?e jestem zalogowany na frakcj? sapd ale nie mog? stawia? kolczatki.


[lua]local kolczatki = {}
local cuboidy = {}
local pojazdy = {[598]=true,[411]=true,[597]=true,[451]=true, [560]=true,}
local odporny = {}

addEventHandler("onPlayerLogin",root,function(prevAcc,currAcc,auto)
local accName = getAccountName(currAcc)
if getElementData(source,'player:duty') and getElementData(source,'player:duty')=='SAPD' then
bindKey(getAccountPlayer(currAcc),"x","down",postawkolczatke)
bindKey(getAccountPlayer(currAcc),"c","down",usunkolczatke)
end
end)

function postawkolczatke(plr,key,keyState)
local veh = getPedOccupiedVehicle(plr)
if pojazdy[getElementModel(veh)] then
setElementData(plr,"odporny",true)
triggerClientEvent(plr,"znajdzmiejsce",plr)
if odporny[plr] then
killTimer(odporny[plr])
end
odporny[plr] = setTimer(function()
setElementData(plr,"odporny",false)
odporny[plr] = nil
end,1000,1)
end
end

addEvent("postaw",true)
addEventHandler("postaw",root,function(x,y,z,rx,ry,rz)
if kolczatki[source] then
destroyElement(kolczatki[source])
kolczatki[source] = nil
destroyElement(cuboidy[source])
cuboidy[source] = nil
end
local kolczatka = createO...
3. Kolczatka
Witam, m?g?by mi kto? pom?c? mam skrypt na kolczatk?, wszystko ?adnie dzia?a tylko nie idzie jej usuwa?.


Skrypt po stronie Client:

[lua]--[[
Author: AteX<[email protected]>
]]--

local ox,oy

addEvent("znajdzmiejsce",true)
addEventHandler("znajdzmiejsce",root,function()
local veh = getPedOccupiedVehicle(localPlayer)
local x,y,z = getVehicleComponentPosition(veh,"bump_rear_dummy","world")
local rx,ry,rz = getVehicleComponentRotation(veh,"bump_rear_dummy","world")
triggerServerEvent("postaw",localPlayer,x,y,z,rx,ry,rz)
end)


function sprawdzaj()
local veh = getPedOccupiedVehicle(localPlayer)
if veh then
local x1,y1,_ = getVehicleComponentPosition(veh,"wheel_lf_dummy","world")
local x2,y2,_ = getVehicleComponentPosition(veh,"wheel_lb_dummy","world")
local x3,y3,_ = getVehicleComponentPosition(veh,"wheel_rf_dummy","world")
local x4,y4,_ = getVehicleComponentPosition(veh,"wheel_rb_dummy","world")
local s1,s2,s3,s4 = getVehicleWheelStates(veh)
local distance1 = getDistanceBetweenPoints2D(x1,y1,ox,oy)
local distance2 = getDistanceBetweenPoints2D(x2,y2,ox,oy)
local distance3 = getDistanceBetweenPoints2D(x3,y3,ox,oy)
local distance4 = getDistanceBetweenPoints2D(x4,y4,ox,oy)
if distance1 < 2 then
if s1 ~= 1 then
triggerServerEvent("przebijopon...
4. Kolczatka
Witam mam tu taki skrypt na kolczatki i czy mo?e kto? mi pom?c ?eby tylko gracz w acl Policja m?g? je rozk?ada? i usuwa?
s:
[lua]function onCreateStinger(x, y, z, rx, ry, rz)
stinger = createObject(2899, x, y, z+0.1, rx, ry, rz)
setElementData(stinger, "isStinger", true)
triggerClientEvent( "onCreateStinger", getRootElement(), x, y, z)
stingerPlant(source)
end
addEvent( "onCreateStinger", true )
addEventHandler( "onCreateStinger", getRootElement(), onCreateStinger)

function stingerPlant(player)
setPedAnimation(player, "BOMBER", "BOM_plant", 3000, false, false, false)
setTimer(setPedAnimation, 2000, 1, player)
end[/lua]
c:
[lua]function getPointFrontOfElement(element,distance)
local x, y, z = getElementPosition ( element )
local rx, ry, rz = getElementRotation ( element )
x = x + (distance * (math.sin(math.rad(-rz))) )
y = y + (distance * (math.cos(math.rad(-rz))) )
return x,y,z
end

function getPositionFromElementAtOffset(element,x,y,z)
if not x or not y or not z then
return x, y, z
end
local matrix = getElementMatrix ( element )
local offX = x * matrix[1][1] + y * matrix[2][1] + z * matrix[3][1] + matrix[4][1]
local offY = x * matrix[1][2] + y * matrix[2][2] + z * matrix[3][2] + matrix[4][2]
local offZ = x * matrix[1][3] + y * matrix[2][3] + z * matrix[3][3] + matrix[4][3]
return offX, of...
5. kolczatka dla poli
Witam zrobi?em skrypt na kolczatke poli lecz gdy j? postawie auto po niej przejedzie to opony si? nie rozwalaj? co robi?.
Kod;

 
function barier(plr
    if 
getElementModel(plr) ~= 280 then return end
    
    local x
,y,getElementPosition(plr)
    
local rx,ry,rz getElementRotation(plr)
        
    
local barierka createObject(2892x,y,z-0.7)
    
setElementData(barierka"isBarierka"true)
    
setElementRotation(barierkarxryrz+90)
    
setElementFrozen(barierkafalse)
    
    
setElementData(barierka"isBarierka2"getPlayerName(plr))
end
addCommandHandler
("kol",barier )
    
function 
barier(plr
    if 
getElementModel(plr) ~= 280 then return end
    
for i,v in ipairs(getElementsByType("object"resourceRoot)) do
      if 
not getElementData(v"isBarierka"then return end
      
if getElementData(v"isBarierka2") == getPlayerName(plrthen
        destroyElement
(v)
     
end
   end
 end
 addCommandHandler
("usb"barier)

Za pomoc stawiam :piwo: :piwo: :piwo: :piwo: :piwo: :piwo:
6. [SKRYPT] Kolczatka dla policji
Przedstawiam kolejny skrypt, kt?ry wam udost?pniam. :)
Jest to skrypt na kolczatk? dla policji. Zasada dzia?ania jest prosta.
Jednym klawiszem k?adziemy kolczatk?, a drugim usuwamy.
K?a?? kolczatki mo?na b?d?c w ACL Policja oraz siedz?c w radiowozie policyjnym.
Mo?na po?o?y? tylko jedn? kolczatk?, wi?c je?eli ponownie postawimy kolczatk? i b?dzie jaka? poprzednia to zniknie.

Bind'y:
X - Postaw kolczatk?
Z - Usu? kolczatk?

SS:



Link do pobrania:
Ukryta wiadomość / Hidden message(aby ją zobaczyć musisz postawić użytkownikowi)
Wiadomość została ukryta, aby ją przeczytać należy się zalogować.

7. Kolczatka
Witam mam taki problem posiadam kolczatke wszystko cacy postawia si? lecz nie usuwa chcia?em zrobi? to sam lecz nie dzia?a Wi?c daje wam linijki na postawianie
Jak mo?ecie to wy?lijcie linijki na usuwanie

function onCreateStinger(xyzrxryrz)
    
stinger createObject(2899xyz+0.1rxryrz)
    
setElementData(stinger"isStinger"true)
    
triggerClientEvent"onCreateStinger"getRootElement(), xyz)
    
stingerPlant(source)
end
addEvent
"onCreateStinger"true )
addEventHandler"onCreateStinger"getRootElement(), onCreateStinger)

function 
stingerPlant(player)
    
setPedAnimation(player"BOMBER""BOM_plant"3000falsefalsefalse)
    
setTimer(setPedAnimation20001player)
end
8. Kolczatka :/
Witam mam pewien problem z kolczatk?,poniewa? gdy wystawiam kolczatk? wszystko ?adnie pi?knie stawia si? lecz gdy auto na ni? wjedzie ko?a nie przebijaj? si? :/
W czym mo?e by? problem?

Tutaj macie kod stawiania i chowania kolczatki je?eli b?dziecie chcieli co? innego piszcie. za pomoc leci Piwko i respekt.

http://pastebin.com/CGNNQT48
9. Kolczatka
Hej, od pewnego czasu szukam kolczatek i nie mog? znale?? a moja mi nie dzia?a, znalaz?em na owym forum jak??, ale te? zbugowana. Wzi??em wi?c z community i wygl?da ona tak:


[lua]local thePlayer = getLocalPlayer()
local theKolczatka = {}
local kolec = {}
function kladz()
if( isPlayerInVehicle( thePlayer ) ) then -- is the player in a car?
if( isElement( theKolczatka[ thePlayer ] ) ) then
destroyElement( theKolczatka[ thePlayer ] )
destroyElement( kolec[ thePlayer ] )
end
local theVehicle = getPlayerOccupiedVehicle( thePlayer )
local rx, ry, rz = getVehicleRotation( theVehicle )
local x, y, z = getElementPosition( theVehicle )
local a = getPlayerRotation( thePlayer )
x = x + math.sin( math.rad(a) ) * 4
y = y - math.cos( math.rad(a) ) * 4
rz = rz + 90
local ziemiaZ = getGroundPosition( x, y, z )
if( ziemiaZ ~= z ) then z = ziemiaZ + 0.2 end
theKolczatka[ thePlayer ] = createObject( 2899, x, y, z, 0, 0, rz )
kolec[ thePlayer ] = createColRectangle( (x - 2.0), (y - 2.0), 4.0, 4.0 )
setElementData( kolec[ thePlayer ], "kolce", "abc" )
outputChatBox( "Roz?o?y?e? kolczatk?!", thePlayer, 255, 0, 0, true )
else
outputChatBox( "Musisz by? w aucie ?eby po?o?yc kolczatk?!", thePlayer, 255, 0, 0, true )
end
end

function kolabum( theElement, matchingDimension )
if( getElementType( theElement ) == "vehicle" and getElementData( source, "kolce" ) == "...
10. Kolczatka
Prosz? o komentarze czy dobrze napisany ;)

Kod:

kolczatka = {}

addcommandHandler ("k", function(plr)
team = getPlayerTeam ( plr )
if getTeamName ( team ) = "Policja" then return end
x,y,z = getElementPosition ( plr )
r1,r2,r3 = getElementRotation ( plr )
kolczatka = createObject ( 2892, x, y, z, r1, r2, r3 )
table.insert ( kolczatka, kolczatka )
end)


addCommandHandler ( "kusun", function(plr)
team = getPlayerTeam ( plr )
if getTeamName ( team ) = "Policja" then return end
for k,v in ipairs ( kolczatka ) do
destroyElement ( v )
end end)
11. [INNE] Kolczatka
Witam. Dzisiaj robilem kolczatke i mam oto takie bledy w komendzie:
[code]D:pawnodiamond.pwn(6315) : warning 219: local variable "x" shadows a variable at a preceding level
D:pawnodiamond.pwn(6315) : warning 219: local variable "y" shadows a variable at a preceding level
D:pawnodiamond.pwn(6315) : warning 219: local variable "z" shadows a variable at a preceding level
D:pawnodiamond.pwn(6316) : error 035: argument type mismatch (argument 2)
D:pawnodiamond.pwn(6318) : warning 213: tag mismatch
D:pawnodiamond.pwn(6318) : warning 213: tag mismatch
D:pawnodiamond.pwn(6318) : warning 213: tag mismatch
D:pawnodiamond.pwn(6318) : warning 213: tag mismatch
D:pawnodiamond.pwn(6315) : warning 203: symbol is never used: "z"
D:pawnodiamond.pwn(6315) : warning 203: symbol is never used: "y"
D:pawnodiamond.pwn(6315) : warning 203: symbol is never used: "x"
D:pawnodiamond.pwn(6315 -- 6323) : warning 225: unreachable code
D:pawnodiamond.pwn(6323) : error 029: invalid expression, assumed zero
D:pawnodiamond.pwn(6323) : error 017: undefined symbol "cmd_usunkolcz"
D:pawnodiamond.pwn(6323) : error 029: invalid expression, assumed zero
D:pawnodiamond.pwn(6323) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.[/code]

Ca?a komenda:
[code]CMD:kolcz(playerid, params[])
{
if(PlayerInfo[playerid][Team] !...
12. [INNE] komenda kolczatka w zcmd. szukam
Witam poszukuj? komendy a rozk?adanie i z?o?enie kolczatki w zcmd.Znajdzie si? co??
13. [INNE] Kolczatka undefined symbol
Witam mam ma?y problem z kolczatk? , nie wiem co z tym zrobi? a dok?adnie jak za definiowa? to
Kod:

if(!ToFrakcja(playerid,2)) return 1;


Kod:

CMD:kol(playerid, cmdtext[])
{
if(!ToFrakcja(playerid,2)) return 1;
if(GetPVarInt(playerid, "Kolczatka") != -1)
{
DestroyObject(GetPVarInt(playerid, "Kolczatka"));
SetPVarInt(playerid, "Kolczatka", -1);
}

new Float:x, Float:y, Float:z, Float:ang;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, ang);

SetPVarInt(playerid, "Kolczatka", CreateObject(2892, x, y, z-1, 0, 0, ang+90));
SendClientMessage(playerid, COLOR_GREEN, "Stworzy?e? kolczatk?. Aby j? usun?? u?yj: /usunkolczatke.");
return 1;
}


B??d

Kod:

C:ppsdakolczatka.pwn(45) : error 017: undefined symbol "ToFrakcja"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.


Jak to naprawi? prosz? o pomoc, i dok?adne podpowiedzi co z tym zrobi?.

Tak przy okazji mo?e wie kto? jak zrobi? cmd kt?ra wywo?uje t? sam? czynno??
u mnie i u kogo? np. cmd na animke kt?ra akceptuje kto? i wykonuje j? w tym samym czasie.[/code]
14. [INNE] Kolczatka
Witam.Pisz? w sprawie i? po wklejeniu systemu kolczatki do mapy w jeden linijce mam error a mianowicie :
Kod:


C:Documents and Settingsu?ytkownikPulpitmap.pwn(7850) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.


A o to ta linijka :

Kod:

public OnPlayerExitVehicle(playerid, vehicleid){
TextDrawHideForPlayer(playerid, naczepa[playerid]);
return 1;
}


if(Flak[vehicleid])
{
SetVehicleToRespawn(vehicleid);
Flak[GetPlayerVehicleID(playerid)] = false;
}
}


A b??d wyskakuje w tej konkretnie linijce :

Kod:

if(Flak[vehicleid])

Za pomoc daje :piwo:
15. Kolczatka
Witam dzi? chce si? zapyta? jak zrobi? ma?a blokad? np. na team lub acl do tego skryptu

serwer


[lua]function onCreateStinger(x, y, z, rx, ry, rz)
stinger = createObject(2899, x, y, z+0.1, rx, ry, rz)
setElementData(stinger, "isStinger", true)
triggerClientEvent( "onCreateStinger", getRootElement(), x, y, z)
stingerPlant(source)
end
addEvent( "onCreateStinger", true )
addEventHandler( "onCreateStinger", getRootElement(), onCreateStinger)

function stingerPlant(player)
setPedAnimation(player, "BOMBER", "BOM_plant", 3000, false, false, false)
setTimer(setPedAnimation, 2000, 1, player)
end
[/lua]

klient

[lua]function getPointFrontOfElement(element,distance)
local x, y, z = getElementPosition ( element )
local rx, ry, rz = getElementRotation ( element )
x = x + (distance * (math.sin(math.rad(-rz))) )
y = y + (distance * (math.cos(math.rad(-rz))) )
return x,y,z
end

function getPositionFromElementAtOffset(element,x,y,z)
if not x or not y or not z then
return x, y, z
end
local matrix = getElementMatrix ( element )
local offX = x * matrix[1][1] + y * matrix[2][1] + z * matrix[3][1] + matrix[4][1]
local offY = x * matrix[1][2] + y * matrix[2][2] + z * matrix[3][2] + matrix[4][2]
local offZ = x * matrix[1][3] + y * matrix[2][3] + z * matrix[3][3] + matrix[4][3]
return offX, offY, offZ
end

function getVehicleWheelPosition(vehicle,w...
16. [INNE] Kolczatka
Witajcie. Mam pytanie odnosz?ce si? do kolczatek w samp. Chcia?bym zrobi? tak? komend? kt?ra po wpisaniu /kolczatka (je?li gracz jest w Team) Pokazuje si? kolczatka i przebija opony. Wiecie jak to zrobic za pomoc daje Piifkoo :D
17. ID kolczatka
Witam chcia?bym si? dowiedzie? czy jest w mta object kolczatka przebijaj?ca opony
je?eli tak to poprosi?bym o ID

z g?ry dzi?ki