Löschbares feuer

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • hey ich hab mir grade das Löschbares feuer eingebaut nun hab ich aba das Problem das ich die Fehler Meldung erhalte


    C:\Users\kifkat\Documents\[POD]\gamemodes\pod.pwn(1716) : error 035: argument type mismatch (argument 4)


    Aiming_at_Flame(playerid)
    {
    new id = -1;
    new Float:dis = 99999.99;
    new Float:dis2;
    new Float:fpx, Float:fpy, Float:fpz;
    new Float:cx,Float:cy,Float:cz,Float:fx,Float:fy,Float:fz;
    GetPlayerCameraPos(playerid, cx, cy, cz);
    GetPlayerCameraFrontVector(playerid, fx, fy, fz);
    for(new i; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i) && PlayerOnFire[i] && (IsInWaterCar(playerid) || HasExtinguisher(playerid) || GetPlayerWeapon(playerid) == 41) && PlayerOnFire[i])
    {
    GetPlayerPos(i, fpx, fpy, fpz);
    dis2 = DistanceCameraTargetToLocation(cx, cy, cz, px, py, pz, fx, fy, fz);//1716
    if(dis2 < dis)
    {
    dis = dis2;
    id = i;
    }
    }
    }
    if(id != -1) { return id-MAX_PLAYERS; }
    for(new i; i < MAX_FLAMES; i++)
    {
    if(Flame[i][Flame_Exists])
    {
    if(IsInWaterCar(playerid) || HasExtinguisher(playerid) || GetPlayerWeapon(playerid) == 41)
    {
    dis2 = DistanceCameraTargetToLocation(cx, cy, cz, Flame[i][Flame_x], Flame[i][Flame_y], Flame[i][Flame_z]+Z_DIFFERENCE, fx, fy, fz);
    if(IsPlayerInAnyVehicle(playerid) && dis2 < CAR_RADIUS && dis2 < dis)
    {
    dis = dis2;
    id = i;
    }
    else if(!IsPlayerInAnyVehicle(playerid) && dis2 < ONFOOT_RADIUS && dis2 < dis)
    {
    dis = dis2;
    id = i;
    }
    }
    }
    }
    if(id != -1)
    {
    if
    (
    (
    IsPlayerInAnyVehicle(playerid) && !IsPlayerInRangeOfPoint(playerid, 50, Flame[id][Flame_x], Flame[id][Flame_y], Flame[id][Flame_z])
    )
    ||
    (
    !IsPlayerInAnyVehicle(playerid) && !IsPlayerInRangeOfPoint(playerid, 5, Flame[id][Flame_x], Flame[id][Flame_y], Flame[id][Flame_z])
    )
    )
    { id = -1; }
    }
    return id;
    }


    Könnt mir da wer helfen ?
    lg kifkat

  • sorry aba sihst du das nicht ? -.-


    Schau dir das an und schau oben :D
    Aiming_at_Flame(playerid)
    {
    new id = -1;
    new Float:dis = 99999.99;
    new Float:dis2;
    new Float:fpx, Float:fpy, Float:fpz;
    new Float:cx,Float:cy,Float:cz,Float:fx,Float:fy,Float:fz;
    GetPlayerCameraPos(playerid, cx, cy, cz);
    GetPlayerCameraFrontVector(playerid, fx, fy, fz);
    for(new i; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i) && PlayerOnFire[i] && (IsInWaterCar(playerid) || HasExtinguisher(playerid) || GetPlayerWeapon(playerid) == 41) && PlayerOnFire[i])
    {
    GetPlayerPos(i, fpx, fpy, fpz);
    dis2 = DistanceCameraTargetToLocation(cx, cy, cz, px, py, pz, fx, fy, fz);//1716

  • Also ich sehe nirgenswo eine Definition von "px/py/pz".
    Kann es sein, dass du die Spielerposition dort übergeben willst?
    Nach der Zeile zuvor wären das aber "fpx/fpy/fpz"


    PS: Kann man mir sagen, was die Funktion DistanceCameraTargetToLocation bewirkt?

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • Ausgefallen ja aba wie behebe ich das nun ?



    Aiming_at_Flame(playerid)
    {
    new id = -1;
    new Float:dis = 99999.99;
    new Float:dis2;
    new Float:px, Float:py, Float:pz;//1692 das wer den Hier
    new Float:cx,Float:cy,Float:cz,Float:fx,Float:fy,Float:fz;
    GetPlayerCameraPos(playerid, cx, cy, cz);
    GetPlayerCameraFrontVector(playerid, fx, fy, fz);
    for(new i; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i) && PlayerOnFire[i] && (IsInWaterCar(playerid) || HasExtinguisher(playerid) || GetPlayerWeapon(playerid) == 41) && PlayerOnFire[i])
    {
    GetPlayerPos(i, px, py, pz);
    dis2 = DistanceCameraTargetToLocation(cx, cy, cz, px, py, pz, fx, fy, fz);
    if(dis2 < dis)
    {
    dis = dis2;
    id = i;
    }
    }
    }
    if(id != -1) { return id-MAX_PLAYERS; }
    for(new i; i < MAX_FLAMES; i++)
    {
    if(Flame[i][Flame_Exists])
    {
    if(IsInWaterCar(playerid) || HasExtinguisher(playerid) || GetPlayerWeapon(playerid) == 41)
    {
    dis2 = DistanceCameraTargetToLocation(cx, cy, cz, Flame[i][Flame_x], Flame[i][Flame_y], Flame[i][Flame_z]+Z_DIFFERENCE, fx, fy, fz);
    if(IsPlayerInAnyVehicle(playerid) && dis2 < CAR_RADIUS && dis2 < dis)
    {
    dis = dis2;
    id = i;
    }
    else if(!IsPlayerInAnyVehicle(playerid) && dis2 < ONFOOT_RADIUS && dis2 < dis)
    {
    dis = dis2;
    id = i;
    }
    }
    }
    }
    if(id != -1)
    {
    if
    (
    (
    IsPlayerInAnyVehicle(playerid) && !IsPlayerInRangeOfPoint(playerid, 50, Flame[id][Flame_x], Flame[id][Flame_y], Flame[id][Flame_z])
    )
    ||
    (
    !IsPlayerInAnyVehicle(playerid) && !IsPlayerInRangeOfPoint(playerid, 5, Flame[id][Flame_x], Flame[id][Flame_y], Flame[id][Flame_z])
    )
    )
    { id = -1; }
    }
    return id;
    }


    den wen ich das in Original lasse bekomme ich die Meldung
    C:\Users\kifkat\Documents\[POD]\gamemodes\pod.pwn(1692) : warning 219: local variable "px" shadows a variable at a preceding level
    C:\Users\kifkat\Documents\[POD]\gamemodes\pod.pwn(1692) : warning 219: local variable "py" shadows a variable at a preceding level
    C:\Users\kifkat\Documents\[POD]\gamemodes\pod.pwn(1692) : warning 219: local variable "pz" shadows a variable at a preceding level
    P


    aba wen ich das Änder

    Aiming_at_Flame(playerid)
    {
    new id = -1;
    new Float:dis = 99999.99;
    new Float:dis2;
    new Float:fpx, Float:fpy, Float:fpz;//das hier
    new Float:cx,Float:cy,Float:cz,Float:fx,Float:fy,Float:fz;
    GetPlayerCameraPos(playerid, cx, cy, cz);
    GetPlayerCameraFrontVector(playerid, fx, fy, fz);
    for(new i; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i) && PlayerOnFire[i] && (IsInWaterCar(playerid) || HasExtinguisher(playerid) || GetPlayerWeapon(playerid) == 41) && PlayerOnFire[i])
    {
    GetPlayerPos(i, fpx, fpy, fpz);//das hier // hier taucht den Auch die Fehler Meldung auf
    dis2 = DistanceCameraTargetToLocation(cx, cy, cz, px, py, pz, fx, fy, fz);
    if(dis2 < dis)
    {
    dis = dis2;
    id = i;
    }
    }
    }
    if(id != -1) { return id-MAX_PLAYERS; }
    for(new i; i < MAX_FLAMES; i++)
    {
    if(Flame[i][Flame_Exists])
    {
    if(IsInWaterCar(playerid) || HasExtinguisher(playerid) || GetPlayerWeapon(playerid) == 41)
    {
    dis2 = DistanceCameraTargetToLocation(cx, cy, cz, Flame[i][Flame_x], Flame[i][Flame_y], Flame[i][Flame_z]+Z_DIFFERENCE, fx, fy, fz);
    if(IsPlayerInAnyVehicle(playerid) && dis2 < CAR_RADIUS && dis2 < dis)
    {
    dis = dis2;
    id = i;
    }
    else if(!IsPlayerInAnyVehicle(playerid) && dis2 < ONFOOT_RADIUS && dis2 < dis)
    {
    dis = dis2;
    id = i;
    }
    }
    }
    }
    if(id != -1)
    {
    if
    (
    (
    IsPlayerInAnyVehicle(playerid) && !IsPlayerInRangeOfPoint(playerid, 50, Flame[id][Flame_x], Flame[id][Flame_y], Flame[id][Flame_z])
    )
    ||
    (
    !IsPlayerInAnyVehicle(playerid) && !IsPlayerInRangeOfPoint(playerid, 5, Flame[id][Flame_x], Flame[id][Flame_y], Flame[id][Flame_z])
    )
    )
    { id = -1; }
    }
    return id;
    }


    bekomme ich die Meldung
    C:\Users\kifkat\Documents\[POD]\gamemodes\pod.pwn(1701) : error 035: argument type mismatch (argument 4)

    3 Mal editiert, zuletzt von Kevin B. ()