Hey, kurze frage unzwar wie scripte ich diese Funktion so um das wenn mann /fraktion sfpd ( soll die Fraktionsid 1 sein ) rein kommt, weil derzeit muss mann /fraktion NAME 1 machen und ich will halb den Namen weg haben und die 1 durch sfpd die 2 durch mafia... kann mir einer helfen?
Lua Code:
function fraktion_func ( player, cmd, target, fraktion )
local target = getPlayerFromName ( target )
local fraktion = tonumber(fraktion)
if vioGetElementData ( player, "adminlvl" ) >= 1 then
if getPlayerPing ( target ) == false then
triggerClientEvent ( player, "infobox_start", getRootElement(), "/fraktion SPIELER FRAKTIONID", 5000, 0, 125, 125 )
else
if getElementData ( target, "loggedin" ) == 1 then
if fraktion >= 0 then
fraktionMembers[vioGetElementData ( target, "fraktion")][target] = nil
if fraktion == 0 then
vioSetElementData ( target, "rang", 0 )
outputChatBox ( "Du bist nun Zivillist", target, 0, 125, 0 )
end
if fraktion == 1 then
vioSetElementData ( target, "rang", 1 )
outputChatBox ( "Du bist nun SFPD", target, 0, 125, 0 )
end
if fraktion == 2 then
vioSetElementData ( target, "rang", 1 )
outputChatBox ( "Du bist nun Mafia", target, 0, 125, 0 )
end
if fraktion == 3 then
vioSetElementData ( target, "rang", 1 )
outputChatBox ( "Du bist nun Triaden", target, 0, 125, 0 )
end
if fraktion == 4 then
vioSetElementData ( target, "rang", 1 )
outputChatBox ( "Du bist nun Terror", target, 0, 125, 0 )
end
if fraktion == 5 then
vioSetElementData ( target, "rang", 1 )
outputChatBox ( "Du bist nun LTR", target, 0, 125, 0 )
end
if fraktion == 6 then
vioSetElementData ( target, "rang", 1 )
outputChatBox ( "Du bist nun FBI", target, 0, 125, 0 )
end
if fraktion == 7 then
vioSetElementData ( target, "rang", 1 )
outputChatBox ( "Du bist nun Los Atzecas", target, 0, 125, 0 )
end
if fraktion == 8 then
vioSetElementData ( target, "rang", 1 )
outputChatBox ( "Du bist nun Army", target, 0, 125, 0 )
end
if fraktion == 9 then
vioSetElementData ( target, "rang", 1 )
outputChatBox ( "Du bist nun NSA", target, 0, 125, 0 )
end
if fraktion == 10 then
vioSetElementData ( target, "rang", 1 )
outputChatBox ( "Du bist nun Angels Of Death", target, 0, 125, 0 )
end
if fraktion == 11 then
vioSetElementData ( target, "rang", 1 )
outputChatBox ( "Du bist nun Ballas", target, 0, 125, 0 )
end
if fraktion == 12 then
vioSetElementData ( target, "rang", 1 )
outputChatBox ( "Du bist nun Hitman", target, 0, 125, 0 )
end
if fraktion == 13 then
vioSetElementData ( target, "rang", 1 )
outputChatBox ( "Du bist nun Medic", target, 0, 125, 0 )
end
if fraktion == 14 then
vioSetElementData ( target, "rang", 1 )
outputChatBox ( "Du bist nun Grove Street", target, 0, 125, 0 )
end
if fraktion == 15 then
vioSetElementData ( target, "rang", 1 )
outputChatBox ( "Du bist nun Mechaniker", target, 0, 125, 0 )
end
if fraktion == 16 then
vioSetElementData ( target, "rang", 1 )
outputChatBox ( "Du bist nun CripZ", target, 0, 125, 0 )
end
if fraktion ~= 0 then
fraktionMembers[fraktion][target] = fraktion
end
vioSetElementData ( target, "fraktion", fraktion )
for playeritem, key in pairs(adminsIngame) do
outputChatBox ( getPlayerName(player).." ist in die Fraktion "..fraktion.." gegangen.", playeritem, 255, 255, 0 )
outputAdminLog(getPlayerName(player).." ist in die Fraktion "..fraktion.." gegangen.")
end
else
triggerClientEvent ( player, "infobox_start", getRootElement(), "\nUngueltige\nFraktions-ID!", 5000, 0, 125, 125 )
end
else
triggerClientEvent ( player, "infobox_start", getRootElement(), "\nSpieler ist\nnicht eingeloggt!", 5000, 0, 125, 125 )
end
end
else
triggerClientEvent ( player, "infobox_start", getRootElement(), "\nDu bist nicht authorisiert,\ndiesen Befehl zu nutzen.", 5000, 255, 0, 0 )
end
end
addCommandHandler ("fraktion", fraktion_func )
Hab ihn so gemacht weil er sonst nicht lesbar ist!