Hallo liebe Mta-Sa-Community,
momentan übe ich mal wieder ein bisschen zu scripten mit dem Godmother, momentan versuche ich mich an einer Fahrschule.
Alles funktioniert auch soweit, man wird ins Auto geportet Makrer sowie Blips werden erstellt und was sonst noch alles.
Jetzt zu meinem problem - hier mal ein ausschnitt aus dem Script:
Lua
function AutoFahrTestFuncGo( thePlayer )
local plname = getPlayerName ( thePlayer )
_G["DriveTestCar"..plname] = createVehicle ( 411, -2752.09, 372.59, 4.15 )
_G["DriveTestPed"..plname] = createPed ( 240, 0, 0, 0 )
_G["DriveTestMarker1"..plname] = createMarker ( -2713.634765625, 413.576171875, 4.1608963012695, "checkpoint", 10, 200,0,0, 255, thePlayer )
_G["DriveTestBlip1"..plname] = createBlip ( -2713.634765625, 413.576171875, 4.1608963012695, 0, 2, 255, 0, 0, 255, 0, 99999.0, thePlayer )
warpPedIntoVehicle ( thePlayer, _G["DriveTestCar"..plname] )
warpPedIntoVehicle ( _G["DriveTestPed"..plname], _G["DriveTestCar"..plname], 1 )
outputChatBox ( "Fahrlehrer: Willkommen in der Fahrprüfung mit dem Auto "..getPlayerName( thePlayer )..".", thePlayer, 200, 200, 0 )
outputChatBox ( "Fahrlehrer: Mit der Taste X schalten Sie den Motor ein/aus.", thePlayer, 200, 200, 0 )
outputChatBox ( "Fahrlehrer: Mit der Taste L schalten Sie das Licht ein/aus.", thePlayer, 200, 200, 0 )
outputChatBox ( "Placeholder.", thePlayer, 200, 200, 0 )
outputChatBox ( "Placeholder.", thePlayer, 200, 200, 0 )
addEventHandler( "onMarkerHit", _G["DriveTestMarker1"..plname], AutoFahrTestStep2 )
end
addCommandHandler( "drivetest", AutoFahrTestFuncGo )
Alles anzeigen
Es kommt immer ein Error in der Console wo dann steht:
attempt to concatenate local 'plname' (a boolean value)
Ich habe da schon hin und her probiert aber ich verstehe nicht wieso er ein problem mit getPlayerName macht