mikou
23
Ok so go back with :
currentTeam = “”
and try:
RegisterCommand('currentTeam', function()
TriggerServerEvent('gw:currentTeamGet')
Wait(100)
currentTeam = currentTeam
if currentTeam ~= nil then --just for debug
print('test'..currentTeam)
print("TEST")
else print("Not found")
end
end)
1 Like
Sezo38
24
same thing, the print is now showing only test
so no currentTeam sadly
mikou
25
Bad debug lol
RegisterCommand('currentTeam', function()
TriggerServerEvent('gw:currentTeamGet')
Wait(100)
if currentTeam ~= '' then --just for debug
print(currentTeam)
)
else print("Not found")
end
end)
1 Like
Sezo38
26
The Event is beeing called.
But no message no print.
That tells us, currentTeam has a value but we can’t read it…
with currentTeam = {} I get as output table:0000003435
a hex code
mikou
27
Can try:
RegisterCommand('currentTeam', function()
TriggerServerEvent('gw:currentTeamGet')
Wait(100)
team = tostsring(currentTeam)
if currentTeam ~= '' then --just for debug
print(team)
)
else print("Not found")
end
end)
1 Like
Sezo38
28
Oh, I had the old debug my bad.
now
RegisterCommand('currentTeam', function()
TriggerServerEvent('gw:currentTeamGet')
Wait(1000)
if currentTeam ~= '' then --just for debug
print(currentTeam)
else
print("Not found")
end
end)
I get Not Found
mikou
29
RegisterCommand('currentTeam', function()
TriggerServerEvent('gw:currentTeamGet')
Wait(100)
team = tostsring(currentTeam)
print(team)
end)
1 Like
Sezo38
30
RegisterCommand('currentTeam', function()
TriggerServerEvent('gw:currentTeamGet')
Wait(100)
team = tostring(currentTeam)
if currentTeam ~= '' then --just for debug
print(team)
else
print("Not found")
end
end)
Not Found 
Sezo38
32
still not showing.
But I found a way.
currentTeam = ''
local cteam
-- Event to get variable currentTeam in client side
RegisterNetEvent('gw:currentTeamSend')
AddEventHandler('gw:currentTeamSend', function(currentTeam)
cteam = currentTeam
end)
RegisterCommand('currentTeam', function()
TriggerServerEvent('gw:currentTeamGet')
Wait(100)
-- team = tostring(currentTeam)
print(cteam)
end)
With cteam its working lol
mikou
33
Lol this for sure a stupid error of me
.
Now i remember.I’ve already encountered this problem,but there focused on the registercommand fonction and miss this.What an asshole
.
1 Like
mikou
34
I don’t think that “local cteam” is useful.
Every thing’s work like you want?
Sezo38
35
Yeah it works from now on.
I don’t think either its not useful but can’t do anything else ^^