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

Wysłany: 2013-04-27, 16:27


Problemior







Wiek: 29
Na forum: 5413 dni
Posty: 5
Nick w MP: Problemior



Respekt: 50

Siema mam skrypt z dru?ynami i nie wiem jaki mam b??d w tym ?eby po wej?ciu dodawa?o do teamu Cywile

Kod:

function createTeamsOnStart ()

teamCywile = createTeam ( "Cywile", 255, 255, 255 )

teamPolicja = createTeam ( "Policja", 28, 134, 238 )
teamPomocDrogowa = createTeam ( "Pomoc Drogowa", 255, 20, 147 )
teamTaxi = createTeam ( "Taxi", 255, 215, 0 )
teamPogotowie = createTeam ( "Pogotowie", 82, 139, 139 )
teamAmmunation = createTeam ( "Ammunation", 54, 54, 54 )


end

addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), teams )


function onPlayerSpawn ( player)
spawnPlayer ( source, -1496.380004828, 920.18511962891, 7.1875 )
setPlayerTeam ( player, Cywile )
givePlayerMoney ( source, 100 )
fadeCamera ( source, true, 3 )
outputChatBox ( "Witaj na serwerze.", source, 0, 255, 255 )
setCameraTarget ( source, source )
end
addEventHandler ( "onPlayerJoin", getRootElement(), onPlayerSpawn )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-27, 16:33


Riot

3X






Wiek: 30
Na forum: 5870 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

Nazwa funkcji: createTeamsOnStart
Funkcja kt?ra ma by? wykonywana po uruchomieniu skryptu: teams (a takiej funkcji nie ma).


Zmie?:

addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), teams )


na:

addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart) 


Powinno dzia?a?, je?li nie to poszukamy innych b??d?w.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-27, 17:23


Problemior







Wiek: 29
Na forum: 5413 dni
Posty: 5
Nick w MP: Problemior



Respekt: 50

niestety nadal nie dodaje do teamu cywile po wej?ciu na serwer

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-27, 17:34


Riot

3X






Wiek: 30
Na forum: 5870 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

function createTeamsOnStart () 

teamCywile = createTeam ( "Cywile", 255, 255, 255 ) 

teamPolicja = createTeam ( "Policja", 28, 134, 238 ) 
teamPomocDrogowa = createTeam ( "Pomoc Drogowa", 255, 20, 147 ) 
teamTaxi = createTeam ( "Taxi", 255, 215, 0 ) 
teamPogotowie = createTeam ( "Pogotowie", 82, 139, 139 ) 
teamAmmunation = createTeam ( "Ammunation", 54, 54, 54 ) 


end 

addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart) 


function onPlayerSpawn () 
spawnPlayer ( source, -1496.380004828, 920.18511962891, 7.1875 ) 
setPlayerTeam ( source, teamCywile ) 
givePlayerMoney ( source, 100 ) 
fadeCamera ( source, true, 3 ) 
outputChatBox ( "Witaj na serwerze.", source, 0, 255, 255 ) 
setCameraTarget ( source, source ) 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), onPlayerSpawn )


Poczytaj o podstawach, robisz dosy? proste b??dy.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-27, 17:43


Problemior







Wiek: 29
Na forum: 5413 dni
Posty: 5
Nick w MP: Problemior



Respekt: 50

dobra ale wi?kszo?? skrypt?w mi dzia?a mojego autorstwa . A co do tego to dalej nie dzia?a ; /

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-27, 17:58


luki123luki123

Place Game






Wiek: 28
Na forum: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

function createTeamsOnStart () 
teamCywile = createTeam ( "Cywile", 255, 255, 255 ) 
teamPolicja = createTeam ( "Policja", 28, 134, 238 ) 
teamPomocDrogowa = createTeam ( "Pomoc Drogowa", 255, 20, 147 ) 
teamTaxi = createTeam ( "Taxi", 255, 215, 0 ) 
teamPogotowie = createTeam ( "Pogotowie", 82, 139, 139 ) 
teamAmmunation = createTeam ( "Ammunation", 54, 54, 54 ) 
end 
addEventHandler ( "onResourceStart", getRootElement(), createTeamsOnStart) 


function onPlayerSpawn (thePlayer) 
spawnPlayer ( thePlayer, -1496.380004828, 920.18511962891, 7.1875 ) 
setPlayerTeam ( thePlayer, teamCywile ) 
givePlayerMoney ( thePlayer, 100 ) 
fadeCamera ( thePlayer, true, 3 ) 
outputChatBox ( "Witaj na serwerze.", thePlayer, 0, 255, 255 )  
end 
addEventHandler ( "onPlayerJoin", getRootElement(), onPlayerSpawn )

Zobacz czy dzia?a :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-27, 18:04


Riot

3X






Wiek: 30
Na forum: 5870 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

M?j kod dzia?a, nawet teraz sprawdzi?em bo si? zdziwi?em. Mo?e co? w dalszej cz??ci kodu masz ?le/nie skopiowa?e? dok?adnie i urwa?o Ci jak?? literke?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-27, 18:14


irvs126

www.lss-rp.pl






Wiek: 37
Na forum: 5602 dni
Posty: 109
Nick w MP: irvs126

Piwa: 97

Respekt: 63,3

Powiedz po jakiej stronie umieszczasz sw?j skrypt.
server/client
Mo?e co? z debuga?(Przed uruchomieniem skryptu wpisz /debugscript 3 )

Podpis
, Sprawdź pierwszy serwer Roleplay, stawiający duży nacisk na grę In Character!
www.lss-rp.pl
Postaw piwo autorowi tego posta
 

 
Tagi: dodawanie :: teamu :: wejściu
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