Jump to content

[HELP] CreatePickup and Team Problem


Recommended Posts

Posted

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 ) 

Posted (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 by Guest

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

  • Moderators
Posted

player is NOT the same as Player This language is upper-case sensitive.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted
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

  • Moderators
Posted

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.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...