Bin zwar nur ein Scriptanfänger. Aber das setElementModel sollte wenn erst nach der Abfrage erscheinen, ob der Spieler Terrorist ist.
Lua
function hitman_func ( player )
local money = tonumber ( vioGetElementData ( player, "money" ) )
if money >= terrorpackage_price then
local x, y, z = getElementPosition ( player )
if getDistanceBetweenPoints3D ( x, y, z, -1998.3441162109, -1537.8443603516, 84.67 ) <= 5 then
if isTerror ( player ) then
if vioGetElementData ( player, "rang" ) >= 3 then
setElementModel ( player, 294)
vioSetElementData ( player, "money", money - hitman_price )
playSoundFrontEnd ( player, 40 )
vioSetElementData ( player, "hasBomb", true )
local weapon = 24
local ammo = 70
giveWeapon ( player, weapon, ammo, true )
local weapon = 25
local ammo = 50
giveWeapon ( player, weapon, ammo, true )
local weapon = 34
local ammo = 30
giveWeapon ( player, weapon, ammo, true )
end
else
outputChatBox ( "Du bist kein Terrorist!", player, 125, 0, 0 )
end
else
outputChatBox ( "Du bist nicht beim Lager!", player, 125, 0, 0 )
end
else
triggerClientEvent ( player, "infobox_start", getRootElement(), "Du hast zu\nwenig Geld!\nDer Skin kostet\n"..skinpreis.." $!", 5000, 125, 0, 0 )
end
end
addCommandHandler ( "hitman", hitman_func )
Alles anzeigen