function comprarbandito ( thePlayer, command)
local playeraccount = getPlayerAccount ( source )
takePlayerMoney ( thePlayer, 500000 )
setAccountData ( playeraccount, "rc.bandito", adquirido )
end
addCommandHandler ( "comprarbandito", comprarbandito )
function Banditoadquirido (_, playeraccount )
if ( playeraccount ) then
local ban = getAccountData ( playeraccount, "rc.bandito" )
if ( ban ) then
Banditocomprado = true
end
end
end
addEvent ( "banditobuyed", true )
addEventHandler ( "banditobuyed", getRootElement(), Banditoadquirido )
This function takes 500000 dollars to give a player permission to use a RC Bandito in a gui (Like in GTA Online)
but, when i put the command "comprarbandito" Bad argument @ getplayeraccount, got nil, i never used getplayeraccount or setplayeraccount, and i don't know if the other function (Banditoadquirido) will work