Bei folgendem Script habe ich ein Problem.(Ist aus dem MTA Wiki)
https://wiki.multitheftauto.com/wiki/CreatePickup
ZitatAlles anzeigen
function createDeathPickup ( totalammo, killer, killerweapon, bodypart ) --when a player dies
x, y, z = getElementPosition ( source ) --get the position of the person who died and define it as x, y and z
currentweapon = getPlayerWeapon ( source ) --get the current weapon of the dead person
createPickup ( x, y, z, 2, currentweapon, 10000, totalammo )
end
addEventHandler ( "onPlayerWasted", getRootElement(), createDeathPickup ) --add an event handler for onPlayerWasted
Sobald der Spieler Tod ist änder sich das Script so: (Halt mit meinen Todes Punkt)
Zitatlocal pdpickup = pickup createPickup ( 1555.0999755859, -1675.6999511719, 16.200000762939, 1247, 3, -1, 0)
function createDeathPickup ( totalammo, killer, killerweapon, bodypart ) --when a player dies
x, y, z = getElementPosition ( source ) --get the position of the person who died and define it as x, y and z
currentweapon = getPlayerWeapon ( source ) --get the current weapon of the dead person
createPickup ( x, y, z, 2, currentweapon, 10000, totalammo )
end
addEventHandler ( "onPlayerWasted", getRootElement(), createDeathPickup ) --add an event handler for onPlayerWasted
Bei diesem Script wird die Waffe des Verstorbenen die er in der Hand hatte fallen gelassen. Aber leider ist das Problem das sich das Pickup nach einmal aufheben, sich nicht mehr löscht. Bedeutet das man die Waffe aufhebt und sie wieder respawnt.
Was muss ich ändern damit die Waffe nur 1 mal spawnt und dann nicht mehr?