Wysłany: 2013-06-10, 17:44
TheTroll
Pan Majster
Wiek: 38 Na forum: 4764 dni Posty: 219
Nick w MP: TheTroll
Piwa : 1114
Siema napisalem wlasny skrypt na teamy do mta. Jest to m?j pierwszy skrypt i mam kilka pyta? do was . 1 pytanie : jak mam zrobi? aby po wejsciu na serwer byc w teamie Trukerzy. tytaj macie kod
Kod: trucker = createTeam ( "Trukerzy", 20, 255, 10 )
policja = createTeam ( "Policja", 0, 100, 255 )
pogotowie = createTeam ( "Pogotowie", 20, 220, 220 )
pomoc = createTeam ( "Pomoc Drogowa", 200, 30, 230 )
taxi = createTeam ( "Taxi", 255, 200, 0 )
function loginPolicja ( player )
setPlayerTeam ( player, policja )
giveWeapon ( player, 3, 1000 )
giveWeapon ( player, 24, 1000 )
giveWeapon ( player, 29, 1000 )
setPedSkin ( player, 280 )
spawnPlayer ( player, -1616, 684, 7 )
setPedNametagColor ( player, 0, 0, 255 )
end
addCommandHandler ( "loginpoli", loginPolicja )
function loginPogotowie ( player )
setPlayerTeam ( player, pogotowie )
giveWeapon ( player, 0, 0 )
setPedSkin ( player, 275 )
spawnPlayer ( player, -2593, 641, 14 )
setPedNametagColor ( player, 0, 0, 255 )
end
addCommandHandler ( "loginpogo", loginPogotowie )
function loginPomoc ( player )
setPlayerTeam ( player, pomoc )
giveWeapon ( player, 0, 0 )
setPedSkin ( player, 260 )
spawnPlayer ( player, -1578, 410, 7 )
setPedNametagColor ( player, 0, 0, 255 )
end
addCommandHandler ( "loginpomoc", loginPomoc )
function loginTaxi ( player )
setPlayerTeam ( player, taxi )
giveWeapon ( player, 0, 0 )
setPedSkin ( player, 20 )
spawnPlayer ( player, -1962, 1744, 12 )
setPedNametagColor ( player, 0, 0, 255 )
end
addCommandHandler ( "logintaxi", loginTaxi )
I jeszcze 1 pytanie : kiedy dodaje kogos do np. Policji komeda ./setteam nick Policja to zmienia mi sie team i jestem w policji ale kidy wyjde i znow wejde na serwer to juz w Policji nie jestem. Za pomoc beda Piwa
Wysłany: 2013-06-10, 17:57
Krawczenko
LUA script
Wiek: 27 Na forum: 4852 dni Posty: 12
Nick w MP: Krawczenko
chodzi ci jak sie dostac?? to masz tam kod na dole np /logintruckerzy czy jakos tak
A jezeli chodzi ci o zalogowanie bez wpisywania to akurat tego nie wiem
Wysłany: 2013-06-10, 18:04
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
TheTroll , 1 pytanie to taki kod :
function teamtruck ( player )
setPlayerTeam ( player , trucker )
setPedSkin ( player , skin )
spawnPlayer ( player , x , y , z )
setPedNametagColor ( player , r , g , b )
end
addEventHandler ( "onPlayerLogin" , root , teamtruck )
*skin - id skin kt?ry ma mie? gracz
*x,y,z - pozycja na mapie respawn
*r,g,b - kolor nicku
2 pytanie :
function setTeam ()
local account = getPlayerAccount ( source )
local team = getAccountData ( account , "team" )
if ( team ) and getTeamFromName ( team ) then
setPlayerTeam ( source , getTeamFromName ( team ))
end
end
addEventHandler ( "onPlayerLogin" , root , setTeam )
function save ()
local team = getPlayerTeam ( source )
local account = getPlayerAccount ( source )
if ( team ) and not isGuestAccount ( account ) then
setAccountData ( account , "team" , getTeamName ( team ))
end
end
addEventHandler ( "onPlayerQuit" , getRootElement (), save )
UWAGA Skrypt tylko b?dzie chodzi? po stronie serwer UWAGA
Wysłany: 2013-06-10, 18:07
TheTroll
Pan Majster
Wiek: 38 Na forum: 4764 dni Posty: 219
Nick w MP: TheTroll
Piwa : 1114
chodzi mi o takie cos ze kiedy wchodzimy na serwer to jestesmy automatycznie juz w teamie Trukerzy bez wpisywania np /logintrucker.
Wysłany: 2013-06-10, 18:17
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
TheTroll , no to jest u mnie tak
Wysłany: 2013-06-10, 18:24
TheTroll
Pan Majster
Wiek: 38 Na forum: 4764 dni Posty: 219
Nick w MP: TheTroll
Piwa : 1114
nie wiem czemu ale nie dziala. Moze ja robie cos zle kod
Kod: trucker = createTeam ( "Trukerzy", 20, 255, 10 )
policja = createTeam ( "Policja", 0, 100, 255 )
pogotowie = createTeam ( "Pogotowie", 20, 220, 220 )
pomoc = createTeam ( "Pomoc Drogowa", 200, 30, 230 )
taxi = createTeam ( "Taxi", 255, 200, 0 )
function loginPolicja ( player )
setPlayerTeam ( player, policja )
giveWeapon ( player, 3, 1000 )
giveWeapon ( player, 24, 1000 )
giveWeapon ( player, 29, 1000 )
setPedSkin ( player, 280 )
spawnPlayer ( player, -1616, 684, 7 )
setPedNametagColor ( player, 0, 0, 255 )
end
addCommandHandler ( "loginpoli", loginPolicja )
function loginPogotowie ( player )
setPlayerTeam ( player, pogotowie )
giveWeapon ( player, 0, 0 )
setPedSkin ( player, 275 )
spawnPlayer ( player, -2593, 641, 14 )
setPedNametagColor ( player, 0, 0, 255 )
end
addCommandHandler ( "loginpogo", loginPogotowie )
function loginPomoc ( player )
setPlayerTeam ( player, pomoc )
giveWeapon ( player, 0, 0 )
setPedSkin ( player, 260 )
spawnPlayer ( player, -1578, 410, 7 )
setPedNametagColor ( player, 0, 0, 255 )
end
addCommandHandler ( "loginpomoc", loginPomoc )
function loginTaxi ( player )
setPlayerTeam ( player, taxi )
giveWeapon ( player, 0, 0 )
setPedSkin ( player, 20 )
spawnPlayer ( player, -1962, 1744, 12 )
setPedNametagColor ( player, 0, 0, 255 )
end
addCommandHandler ( "logintaxi", loginTaxi )
function teamtruck(player)
setPlayerTeam ( player, trucker )
setPedSkin ( player, 21)
spawnPlayer ( player, -1962,1744,12 )
setPedNametagColor ( player, 20, 255, 10 )
end
addEventHandler("onPlayerLogin",root,teamtruck)
function setTeam()
local account = getPlayerAccount(source)
local team = getAccountData (account, "team")
if (team) and getTeamFromName(team) then
setPlayerTeam(source, getTeamFromName(team))
end
end
addEventHandler("onPlayerLogin",root,setTeam)
function save()
local team = getPlayerTeam(source)
local account = getPlayerAccount(source)
if (team) and not isGuestAccount(account) then
setAccountData(account, "team", getTeamName(team))
end
end
addEventHandler("onPlayerQuit", getRootElement(), save)
Wysłany: 2013-06-10, 18:37
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
TheTroll , w mecie musi by? jak masz skrypt type="server" ito diza?a na zasadzie sie zalogowania
Wysłany: 2013-06-10, 19:00
TheTroll
Pan Majster
Wiek: 38 Na forum: 4764 dni Posty: 219
Nick w MP: TheTroll
Piwa : 1114
w mecie mam skrypt type="server" ale i tak nie dziala . Wgraj ten skrypt u ciebie i zobacz czy dziala.
Wysłany: 2013-06-10, 20:49
Riot
3X
Wiek: 29 Na forum: 5729 dni Posty: 1123
Nick w MP: Riot/3X
Piwa : 286
"luki123luki123" napisał/a :setPlayerTeam ( player, trucker ) setPedSkin ( player, skin) spawnPlayer ( player, x,y,z )
Funkcja spawnPlayer mo?e od razu zmienia? team i skin. Po kij sobie utrudnia??
Wysłany: 2013-06-11, 17:44
TheTroll
Pan Majster
Wiek: 38 Na forum: 4764 dni Posty: 219
Nick w MP: TheTroll
Piwa : 1114
Ziomek11 , mozesz powiedziec jak mam to zrobic? zrobilem tak jak mowil luki123luki123 , ale nie dziala
Wysłany: 2013-06-11, 20:09
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
trucker = createTeam ( "Trukerzy" , 20 , 255 , 10 )
policja = createTeam ( "Policja" , 0 , 100 , 255 )
pogotowie = createTeam ( "Pogotowie" , 20 , 220 , 220 )
pomoc = createTeam ( "Pomoc Drogowa" , 200 , 30 , 230 )
taxi = createTeam ( "Taxi" , 255 , 200 , 0 )
function loginPolicja ( thethePlayer )
setthePlayerTeam ( thePlayer , policja )
giveWeapon ( thePlayer , 3 , 1000 )
giveWeapon ( thePlayer , 24 , 1000 )
giveWeapon ( thePlayer , 29 , 1000 )
setPedSkin ( thePlayer , 280 )
spawnthePlayer ( thePlayer , - 1616 , 684 , 7 )
setPedNametagColor ( thePlayer , 0 , 0 , 255 )
end
addCommandHandler ( "loginpoli" , loginPolicja )
function loginPogotowie ( thePlayer )
setthePlayerTeam ( thePlayer , pogotowie )
giveWeapon ( thePlayer , 0 , 0 )
setPedSkin ( thePlayer , 275 )
spawnthePlayer ( thePlayer , - 2593 , 641 , 14 )
setPedNametagColor ( thePlayer , 0 , 0 , 255 )
end
addCommandHandler ( "loginpogo" , loginPogotowie )
function loginPomoc ( thePlayer )
setthePlayerTeam ( thePlayer , pomoc )
giveWeapon ( thePlayer , 0 , 0 )
setPedSkin ( thePlayer , 260 )
spawnthePlayer ( thePlayer , - 1578 , 410 , 7 )
setPedNametagColor ( thePlayer , 0 , 0 , 255 )
end
addCommandHandler ( "loginpomoc" , loginPomoc )
function loginTaxi ( thePlayer )
setthePlayerTeam ( thePlayer , taxi )
giveWeapon ( thePlayer , 0 , 0 )
setPedSkin ( thePlayer , 20 )
spawnthePlayer ( thePlayer , - 1962 , 1744 , 12 )
setPedNametagColor ( thePlayer , 0 , 0 , 255 )
end
addCommandHandler ( "logintaxi" , loginTaxi )
function teamtruck ( thePlayer )
setthePlayerTeam ( thePlayer , trucker )
setPedSkin ( thePlayer , 21 )
spawnthePlayer ( thePlayer , - 1962 , 1744 , 12 )
setPedNametagColor ( thePlayer , 20 , 255 , 10 )
end
addEventHandler ( "onthePlayerLogin" , root , teamtruck )
function setTeam ( thePlayer )
local account = getthePlayerAccount ( thePlayer )
local team = getAccountData ( account , "team" )
if ( team ) and getTeamFromName ( team ) then
setthePlayerTeam ( thePlayer , getTeamFromName ( team ))
end
end
addEventHandler ( "onthePlayerLogin" , root , setTeam )
function save ( thePlayer )
local team = getthePlayerTeam ( source )
local account = getthePlayerAccount ( thePlayer )
if ( team ) and not isGuestAccount ( account ) then
setAccountData ( account , "team" , getTeamName ( team ))
end
end
addEventHandler ( "onthePlayerQuit" , getRootElement (), save ) a teraz
Wysłany: 2013-06-11, 21:02
TheTroll
Pan Majster
Wiek: 38 Na forum: 4764 dni Posty: 219
Nick w MP: TheTroll
Piwa : 1114
niestety nie
Wysłany: 2013-06-11, 22:51
Tostuch
Wiek: 27 Na forum: 4931 dni Posty: 483
Nick w MP: Tost
Piwa : 137
luki123luki123 , popatrz co piszesz bo napisa?e? w eventach i funkcjach thePlayer zamiast Player. Masz poprawiony kod, powinno ?miga?.
trucker = createTeam ( "Trukerzy" , 20 , 255 , 10 )
policja = createTeam ( "Policja" , 0 , 100 , 255 )
pogotowie = createTeam ( "Pogotowie" , 20 , 220 , 220 )
pomoc = createTeam ( "Pomoc Drogowa" , 200 , 30 , 230 )
taxi = createTeam ( "Taxi" , 255 , 200 , 0 )
function loginPolicja ( thethePlayer )
setPlayerTeam ( thePlayer , policja )
giveWeapon ( thePlayer , 3 , 1000 )
giveWeapon ( thePlayer , 24 , 1000 )
giveWeapon ( thePlayer , 29 , 1000 )
setPedSkin ( thePlayer , 280 )
spawnPlayer ( thePlayer , - 1616 , 684 , 7 )
setPedNametagColor ( thePlayer , 0 , 0 , 255 )
end
addCommandHandler ( "loginpoli" , loginPolicja )
function loginPogotowie ( thePlayer )
setPlayerTeam ( thePlayer , pogotowie )
giveWeapon ( thePlayer , 0 , 0 )
setPedSkin ( thePlayer , 275 )
spawnPlayer ( thePlayer , - 2593 , 641 , 14 )
setPedNametagColor ( thePlayer , 0 , 0 , 255 )
end
addCommandHandler ( "loginpogo" , loginPogotowie )
function loginPomoc ( thePlayer )
setPlayerTeam ( thePlayer , pomoc )
giveWeapon ( thePlayer , 0 , 0 )
setPedSkin ( thePlayer , 260 )
spawnPlayer ( thePlayer , - 1578 , 410 , 7 )
setPedNametagColor ( thePlayer , 0 , 0 , 255 )
end
addCommandHandler ( "loginpomoc" , loginPomoc )
function loginTaxi ( thePlayer )
setPlayerTeam ( thePlayer , taxi )
giveWeapon ( thePlayer , 0 , 0 )
setPedSkin ( thePlayer , 20 )
spawnPlayer ( thePlayer , - 1962 , 1744 , 12 )
setPedNametagColor ( thePlayer , 0 , 0 , 255 )
end
addCommandHandler ( "logintaxi" , loginTaxi )
function teamtruck ( thePlayer )
setPlayerTeam ( thePlayer , trucker )
setPedSkin ( thePlayer , 21 )
spawnPlayer ( thePlayer , - 1962 , 1744 , 12 )
setPedNametagColor ( thePlayer , 20 , 255 , 10 )
end
addEventHandler ( "onPlayerLogin" , root , teamtruck )
function setTeam ( thePlayer )
local account = getPlayerAccount ( thePlayer )
local team = getAccountData ( account , "team" )
if ( team ) and getTeamFromName ( team ) then
setPlayerTeam ( thePlayer , getTeamFromName ( team ))
end
end
addEventHandler ( "onPlayerLogin" , root , setTeam )
function save ( thePlayer )
local team = getPlayerTeam ( source )
local account = getPlayerAccount ( thePlayer )
if ( team ) and not isGuestAccount ( account ) then
setAccountData ( account , "team" , getTeamName ( team ))
end
end
addEventHandler ( "onPlayerQuit" , getRootElement (), save )
Wysłany: 2013-06-12, 08:45
Riot
3X
Wiek: 29 Na forum: 5729 dni Posty: 1123
Nick w MP: Riot/3X
Piwa : 286
trucker = createTeam ( "Trukerzy" , 20 , 255 , 10 )
policja = createTeam ( "Policja" , 0 , 100 , 255 )
pogotowie = createTeam ( "Pogotowie" , 20 , 220 , 220 )
pomoc = createTeam ( "Pomoc Drogowa" , 200 , 30 , 230 )
taxi = createTeam ( "Taxi" , 255 , 200 , 0 )
function loginPolicja ( thePlayer )
setPlayerTeam ( thePlayer , policja )
giveWeapon ( thePlayer , 3 , 1000 )
giveWeapon ( thePlayer , 24 , 1000 )
giveWeapon ( thePlayer , 29 , 1000 )
setPedSkin ( thePlayer , 280 )
spawnPlayer ( thePlayer , - 1616 , 684 , 7 )
setPedNametagColor ( thePlayer , 0 , 0 , 255 )
end
addCommandHandler ( "loginpoli" , loginPolicja )
function loginPogotowie ( thePlayer )
setPlayerTeam ( thePlayer , pogotowie )
giveWeapon ( thePlayer , 0 , 0 )
setPedSkin ( thePlayer , 275 )
spawnPlayer ( thePlayer , - 2593 , 641 , 14 )
setPedNametagColor ( thePlayer , 0 , 0 , 255 )
end
addCommandHandler ( "loginpogo" , loginPogotowie )
function loginPomoc ( thePlayer )
setPlayerTeam ( thePlayer , pomoc )
giveWeapon ( thePlayer , 0 , 0 )
setPedSkin ( thePlayer , 260 )
spawnPlayer ( thePlayer , - 1578 , 410 , 7 )
setPedNametagColor ( thePlayer , 0 , 0 , 255 )
end
addCommandHandler ( "loginpomoc" , loginPomoc )
function loginTaxi ( thePlayer )
setPlayerTeam ( thePlayer , taxi )
giveWeapon ( thePlayer , 0 , 0 )
setPedSkin ( thePlayer , 20 )
spawnPlayer ( thePlayer , - 1962 , 1744 , 12 )
setPedNametagColor ( thePlayer , 0 , 0 , 255 )
end
addCommandHandler ( "logintaxi" , loginTaxi )
function teamtruck ( thePlayer )
setPlayerTeam ( thePlayer , trucker )
setPedSkin ( thePlayer , 21 )
spawnPlayer ( thePlayer , - 1962 , 1744 , 12 )
setPedNametagColor ( thePlayer , 20 , 255 , 10 )
end
addEventHandler ( "onPlayerLogin" , root , teamtruck )
function setTeam ( thePlayer )
local account = getPlayerAccount ( thePlayer )
local team = getAccountData ( account , "team" )
if ( team ) and getTeamFromName ( team ) then
setPlayerTeam ( thePlayer , getTeamFromName ( team ))
end
end
addEventHandler ( "onPlayerLogin" , root , setTeam )
function save ()
local team = getPlayerTeam ( source )
local account = getPlayerAccount ( source )
if ( team ) and not isGuestAccount ( account ) then
setAccountData ( account , "team" , getTeamName ( team ))
end
end
addEventHandler ( "onPlayerQuit" , getRootElement (), save )
Wysłany: 2013-06-12, 17:56
TheTroll
Pan Majster
Wiek: 38 Na forum: 4764 dni Posty: 219
Nick w MP: TheTroll
Piwa : 1114
niestety dalej nie dziala kiedy wchodze na serwer i sie loguje to nie jestem w zadnej frakcji
Tagi: teamy
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: