Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2015-07-31, 08:49


pomaza







Wiek: 39
Na forum: 3982 dni
Posty: 79

Piwa: 2

Respekt: 50

Witam mam skrypt na po?ary ale niestety jak go stworze to tylko ja go widze.
To jest kod:
serwer
Kod:


function scriptCreateFire ( player, command )
local acc = getAccountName (getPlayerAccount(player))
if isObjectInACLGroup ("user."..acc, aclGetGroup ("Admin")) then
local luckyBugger = getRandomPlayer() -- get a random player
local x, y, z = getElementPosition ( luckyBugger ) -- retrive the player's position
createFire ( x + 5 , y, z , 20) -- create the fire in the player's position but with x + 5
end
end
--Attach the 'scriptCreateFire' function to the "flame" command
addCommandHandler ( "flamefogo", scriptCreateFire ) -- /flame is the command to activate the script

a tu client
Kod:

function scriptCreateFire ( commandName )
local luckyBugger = getLocalPlayer() -- get the local player
local x, y, z = getElementPosition ( luckyBugger ) -- retrive the player's position
createFire ( x + 5 , y, z , 20) -- create the fire in the player's position but with x +5
end
--Attach the 'scriptCreateFire' function to the "flame" command
addCommandHandler ( "flame", scriptCreateFire ) -- /flame is the command to activate the script

Bym chcia? ?eby ka?dy j? widzia? a jak to robi? ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-31, 09:12


Fanciak

BOT






Wiek: 25
Na forum: 4446 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

Pobaw si? stronami skryptu ( client / server )

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-31, 09:53


Loop

Inspektor






Wiek: 27
Na forum: 4289 dni
Posty: 311
Nick w MP: Inspektor

Piwa: 201

Respekt: 130
Respekt: 130

Z clienta zmieniasz na server proste.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-31, 11:26


pomaza







Wiek: 39
Na forum: 3982 dni
Posty: 79

Piwa: 2

Respekt: 50

Tera wgl nie dziala

[ Dodano: 2015-07-31, 11:33 ]
blad : tu call global 'getLocalPlayer' (a nil value)

[ Dodano: 2015-07-31, 11:33 ]
to call *

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-31, 11:46


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%

function scriptCreateFire (gracz,  commandName local xygetElementPosition gracz)
createFire y20)
end 

addCommandHandler "flame"scriptCreateFire )


C-SIDE

Poczytaj sobie jakie argumenty zwraca addCommandHandler, zrozumiesz b??d


Więcej informacji znajdziesz w Wikipedii MTA:

addCommandHandler


Postaw piwo autorowi tego posta
 

 
Tagi: ogien
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku