opnaiC Posted May 9, 2016 Share Posted May 9, 2016 Hello, made a LSPD team system, I have all finished but I dont know why this scipt doesnt work!? After picking up the pickup you should get a cop uniform when you are in the LSPD team. But it isnt working... BTW how I can add a payday system in this scipt? As example when your 30 min in the cop uniform you will get 300$. coppickup = createPickup( 238.19999694824, 80.300003051758, 1005, 3, 1275, 1, 1 ) setElementInterior ( coppickup, 6 ) function startCopJob (player) local team = getPlayerTeam(player) if (getTeamName(team)== "LSPD") then setElementModel(player, 280) outputChatBox("Вы начали рабочий день!", Player, 0,191,255) else outputChatBox("Вы не сотрудник LSPD!", Player, 0,191,255) end end addEventHandler ( "onPickupHit", coppickup, startCopJob ) Link to comment
Dimos7 Posted May 9, 2016 Share Posted May 9, 2016 is your player in team LSPD? if not then will not work Link to comment
opnaiC Posted May 9, 2016 Author Share Posted May 9, 2016 Player is in LSPD but still dont work .. Link to comment
Walid Posted May 9, 2016 Share Posted May 9, 2016 (edited) Player is in LSPD but still dont work .. Use /debugscript 3 and try this function startCopJob (player) if player and isElement(player) then local team = getPlayerTeam(player) if team then if (getTeamName(team)== "LSPD") then setElementModel(player, 280) outputChatBox("Вы начали рабочий день!", player, 0,191,255) else outputChatBox("Вы не сотрудник LSPD!", player, 0,191,255) end end end end addEventHandler ( "onPickupHit", coppickup, startCopJob ) Edited May 9, 2016 by Guest Link to comment
Moderators IIYAMA Posted May 9, 2016 Moderators Share Posted May 9, 2016 player is NOT the same as Player This language is upper-case sensitive. Link to comment
opnaiC Posted May 10, 2016 Author Share Posted May 10, 2016 Player is in LSPD but still dont work .. Use /debugscript 3 and try this function startCopJob (player) if player and isElement(player) then local team = getPlayerTeam(player) if team then if (getTeamName(team)== "LSPD") then setElementModel(player, 280) outputChatBox("Вы начали рабочий день!", player, 0,191,255) else outputChatBox("Вы не сотрудник LSPD!", player, 0,191,255) end end end end addEventHandler ( "onPickupHit", coppickup, startCopJob ) In debugscript is says nothing when I hit the marker or not. Just says nothing about this marker... Idk what to do Link to comment
Moderators IIYAMA Posted May 10, 2016 Moderators Share Posted May 10, 2016 Debugging isn't just watching the stupid console, it is much more than that. So read this page: https://wiki.multitheftauto.com/wiki/Debugging Read everything! Except for Debugging Performance Issues. The most important subject is: "Debug strategies" So make sure you study especially that one. Link to comment
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