Jump to content

Help Jobs bugged


Tando

Recommended Posts

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
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 by (SAUG)Tando
Link to comment

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 by Peti
Link to comment
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

 

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
  • Moderators

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 by DNL291
fix
Link to comment
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
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
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
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

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...