Tando Posted January 22, 2019 Share Posted January 22, 2019 (edited) function firstscript (player) if getElementData(player, "Clan") ~= "None" then if getElementData(player, "Job", "CIA") then exports.Messages:sendClientMessage( "You Have to be part in gang for take it ",player, 255, 0, 0) return end end end it's not working This script working as if player isn't in clan so can't take CIA Jobs Edited January 22, 2019 by (SAUG)Tando Link to comment
VenomOG Posted January 22, 2019 Share Posted January 22, 2019 function firstscript (player) if not getElementData(player, "Clan", "CIA") then exports.Messages:sendClientMessage( "You Have to be part in gang for take it ",player, 255, 0, 0) setElementDataplayer,"Job","Unemployed") end setTimer(firstscript,50,0) Link to comment
Tando Posted January 22, 2019 Author Share Posted January 22, 2019 1 minute ago, Knuck said: function firstscript (player) if not getElementData(player, "Clan", "CIA") then exports.Messages:sendClientMessage( "You Have to be part in gang for take it ",player, 255, 0, 0) setElementDataplayer,"Job","Unemployed") end setTimer(firstscript,50,0) iam not mean like that i mean if player haven't clan can't take it Link to comment
VenomOG Posted January 22, 2019 Share Posted January 22, 2019 1 minute ago, (SAUG)Tando said: iam not mean like that i mean if player haven't clan can't take it :Oing obviolusly when take the job in 5 miliseconds he will be kicked from it... Link to comment
Tando Posted January 22, 2019 Author Share Posted January 22, 2019 (edited) 6 minutes ago, Knuck said: :Oing obviolusly when take the job in 5 miliseconds he will be kicked from it... NOT working and iam mean if clan = None so Can't take job name CIA 1 minute ago, (SAUG)Tando said: NOT working and iam mean if clan = None so Can't take job name CIA LIKE Thugs Edited January 22, 2019 by (SAUG)Tando Link to comment
Peti Posted January 23, 2019 Share Posted January 23, 2019 (edited) Are you exports defined correctly? <export function="functionName" type="theType"/> BTW, try this: function firstscript (player) if not getElementData(player, "Clan") then if getElementData(player, "Job") == "CIA" then exports.Messages:sendClientMessage( "You Have to be part in gang for take it ",player, 255, 0, 0) return end end end OR function firstscript (player) if getElementData(player, "Clan") ~= "None" then if getElementData(player, "Job") == "CIA" then exports.Messages:sendClientMessage( "You Have to be part in gang for take it ",player, 255, 0, 0) return end end end I don't really understand what are you trying to do, so I don't guaranteed that my suggestion will work Edited January 23, 2019 by Peti Link to comment
DNL291 Posted January 23, 2019 Share Posted January 23, 2019 if getElementData(player, "Job", "CIA") then It's not that way you'll check if the element-data is "CIA". Correct way: if getElementData(player, "Job") == "CIA" then Link to comment
Tando Posted January 23, 2019 Author Share Posted January 23, 2019 9 hours ago, Peti said: Are you exports defined correctly? <export function="functionName" type="theType"/> BTW, try this: function firstscript (player) if not getElementData(player, "Clan") then if getElementData(player, "Job") == "CIA" then exports.Messages:sendClientMessage( "You Have to be part in gang for take it ",player, 255, 0, 0) return end end end OR function firstscript (player) if getElementData(player, "Clan") ~= "None" then if getElementData(player, "Job") == "CIA" then exports.Messages:sendClientMessage( "You Have to be part in gang for take it ",player, 255, 0, 0) return end end end I don't really understand what are you trying to do, so I don't guaranteed that my suggestion will work Not working my script working as if u haven't clan u can't take job name CIA Msg"You Have to be Part in clan for take it" like if player isn't in clan so he can't take this job just players who have clan take it Link to comment
Tando Posted January 27, 2019 Author Share Posted January 27, 2019 On 23/01/2019 at 05:08, DNL291 said: if getElementData(player, "Job", "CIA") then It's not that way you'll check if the element-data is "CIA". Correct way: if getElementData(player, "Job") == "CIA" then it's not working bcs all can take job i need it when player haven't clan and tried to take job he can't and give msg to him saying " you must be part in clan for take this job" Job only for clans so who haven't clan can't open gui or take it Link to comment
DNL291 Posted January 27, 2019 Share Posted January 27, 2019 (edited) This should work: function firstscript (player) if not (getElementData(player, "Clan")) or getElementData(player, "Clan") == "None" and (getElementData(player, "Job") == "CIA") then return exports.Messages:sendClientMessage( "You Have to be part in gang for take it ",player, 255, 0, 0) end end If it doesn't work, show us how you're calling that function. Edit: Note that this will check if the player already has this Job, but I think you want to prevent the player from taking this job, in this case you'll need to show us the other part of the code. Edited January 27, 2019 by DNL291 fix Link to comment
Tando Posted January 27, 2019 Author Share Posted January 27, 2019 1 hour ago, DNL291 said: This should work: function firstscript (player) if not (getElementData(player, "Clan")) or getElementData(player, "Clan") == "None" and (getElementData(player, "Job") == "CIA") then return exports.Messages:sendClientMessage( "You Have to be part in gang for take it ",player, 255, 0, 0) end end If it doesn't work, show us how you're calling that function. Edit: Note that this will check if the player already has this Job, but I think you want to prevent the player from taking this job, in this case you'll need to show us the other part of the code. still player can take job Just now, (SAUG)Tando said: still player can take job Edit: Note that this will check if the player already has this Job, but I think you want to prevent the player from taking this job, in this case you'll need to show us the other part of the code. yea i want this player if haven't clan can't take job Link to comment
DNL291 Posted January 28, 2019 Share Posted January 28, 2019 5 hours ago, (SAUG)Tando said: yea i want this player if haven't clan can't take job So, where's the code? The function you provided is incomplete. Link to comment
SuperVisor Posted January 28, 2019 Share Posted January 28, 2019 24 minutes ago, DNL291 said: So, where's the code? The function you provided is incomplete. Function CIA If getElementData(player, "Job") == "CIA" Then If getElementData(player,"Clan") == "None" then Cancelevent() exports.Messages:sendClientMessage("You must have clan to take CIA Job",player, 150,150,150) end end end Just now, SuperVisor said: Function CIA If getElementData(player, "Job") == "CIA" Then If getElementData(player,"Clan") == "None" then Cancelevent() exports.Messages:sendClientMessage("You must have clan to take CIA Job",player, 150,150,150) end end end Like if player have stars cant take job This script like this Or if get clan SWAT so cancelevent msg: SWAT Cant take CIA Job Link to comment
Tando Posted January 29, 2019 Author Share Posted January 29, 2019 On 28/01/2019 at 03:32, DNL291 said: So, where's the code? The function you provided is incomplete. Function CIA ( player ) If getElementData(player, "Job") == "CIA" Then If getElementData(player,"Clan") == "None" then Cancelevent() exports.Messages:sendClientMessage("You must have clan to take CIA Job",player, 150,150,150) end end end 1 minute ago, (SAUG)Tando said: Function CIA ( player ) If getElementData(player, "Job") == "CIA" Then If getElementData(player,"Clan") == "None" then Cancelevent() exports.Messages:sendClientMessage("You must have clan to take CIA Job",player, 150,150,150) end end end local pclan = getElementData(player, "Clan") if(row["clantp"] ~= 0 and getElementData(player, "Clan") ~= "None" and getClanType(player) == row["clantp"]) then exports.Messages:sendClientMessage( "You can't take this job because your clan type does not allow that!",player, 255, 0, 0) return end This from our Job server side Link to comment
Mr.Loki Posted January 30, 2019 Share Posted January 30, 2019 function firstscript (player) if getElementData(player, "Job") ~= "CIA" then if not getElementData(player, "Clan") or getElementData(player, "Clan") == "None" then exports.Messages:sendClientMessage( "You Have to be part in gang for take it ",player, 255, 0, 0) return end end end Link to comment
Tando Posted January 30, 2019 Author Share Posted January 30, 2019 (edited) 2 hours ago, Mr.Loki said: function firstscript (player) if getElementData(player, "Job") ~= "CIA" then if not getElementData(player, "Clan") or getElementData(player, "Clan") == "None" then exports.Messages:sendClientMessage( "You Have to be part in gang for take it ",player, 255, 0, 0) return end end end did u see ? @DNL291 Edited January 30, 2019 by (SAUG)Tando 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