Problem mit OnPlayerDeath

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
  • Hi,


    ich habe versucht so zu scripten das dann im Chat steht:
    Text bei Player2: "Du hast Player1 getötet!"
    und Text bei Player1: "Du wurdest von PLayer2 getötet!"
    aber bei mir kommen 2 Errors:


    Mein OnPlayerDeath Ding ^^


    Function OnPlayerDeath(playerid, killerid, reason)
    {
    GW_OnPlayerDeath(playerid, killerid, reason);
    M_OnPlayerDeath(playerid,killerid,reason);
    SendDeathMessage(killerid, playerid, reason);
    new string2[200];
    format(string2,sizeof(string2),"%s hat dich getötet!",killerid);
    SendClientMessage(playerid,string2);
    format(string2,sizeof(string2),"Du hast %s getötet!",playerid);
    SendClientMessage(killerid,string2);
    new Float:pX,Float:pY,Float:pZ;
    GetPlayerPos(playerid, pX, pY, pZ);
    TotenKopf[playerid] = CreatePickup(1275,1, pX, pY, pZ);
    SetTimerEx("tot", 90000, false, "d", playerid);
    new Float:x, Float:y, Float:z, name[MAX_PLAYER_NAME];
    GetPlayerPos(playerid, Float:x, Float:y, Float:z);
    GetPlayerName(playerid, name, sizeof(name));
    format(stringz, sizeof(stringz), "%s", name);
    DeathText[playerid] = Create3DTextLabel(stringz,0xFFFFFFAA, Float:x, Float:y, Float:z, 10.0, 0);
    new string[256];
    PlayerInfo[playerid][pInvWeapon] = 0;
    PlayerInfo[playerid][pInvAmmo] = 0;
    PlayerInfo[playerid][pInvWeapon2] = 0;
    PlayerInfo[playerid][pInvAmmo2] = 0;
    PlayerInfo[playerid][pMats] = 0;
    PlayerInfo[playerid][pDrugs] = 0;
    FrakMatsHolding[playerid] = 0;
    //Death
    if(PlayerInfo[playerid][pKrankenkasse] == 0)
    {
    GivePlayerMoney(playerid, -1500);
    SetPlayerHealth(playerid,150);
    FraktionsKasse[4] += 1500;
    }
    if(PlayerInfo[playerid][pKrankenkasse] == 1)
    {
    FraktionsKasse[4] += 1500;
    }
    //Death
    new playercash;
    new victimteam;
    new killerteam;
    /*if(!IsACop(killerid))
    {
    WantedPoints[killerid]+=2;
    SetPlayerCriminal(killerid,255,"Vorsätzlicher Mord");
    }*/
    if(PlayerInfo[playerid][pLevel] > 2 && KHSperre[playerid] == 0 && PlayerInfo[playerid][pJailed] == 0 && PlayerInfo[playerid][pwJailed] == 0 && PlayerInfo[playerid][pGangJailed] == 0 && PlayerPaintballing[playerid] == 0)
    {
    PlayerInfo[playerid][pTot] = 1;
    }
    if(gPlayerUsingLoopingAnim[playerid])
    {
    gPlayerUsingLoopingAnim[playerid] = 0;
    TextDrawHideForPlayer(playerid,txtAnimHelper);
    }
    if(PlayerOnFire[playerid])
    {
    SendClientMessage(playerid, 0xff000000, "Du bist verbrannt!"); StopPlayerBurning(playerid);
    }
    if(BlindFold[playerid] == 1)
    {
    BlindFold[playerid] = 0;
    }
    if(PlayerInfo[playerid][pMauled] == 1)
    {
    PlayerInfo[playerid][pMauled] = 0;
    }
    InCargo[playerid] = 0; InLevi[playerid] = 0; InEnfo[playerid] = 0;
    if(FirstSpawn[playerid] == 1)
    {
    FirstSpawn[playerid] = 0;
    }
    if(TakeOverTime[playerid] > 0)
    {
    for(new idd; idd<GangZones_Index;idd++)
    {
    if(idd == TakeOver[playerid])
    {
    GangZoneStopFlashForAll(GangZones[idd][gzID]);
    }
    }
    new job, job2;
    if(PlayerInfo[playerid][pMember] >0)
    {
    job = PlayerInfo[playerid][pMember];
    }
    else if(PlayerInfo[playerid][pLeader] >0)
    {
    job = PlayerInfo[playerid][pLeader];
    }
    format(ALLSTRING, sizeof(ALLSTRING), "Der Angreifer ist gestorben, Angriff fehlgeschlagen.");
    for(new i; i<MAX_PLAYERS; i++)
    {
    if(PlayerInfo[i][pMember] >0)
    {
    job2 = PlayerInfo[i][pMember];
    }
    else if(PlayerInfo[i][pLeader] >0)
    {
    job2 = PlayerInfo[i][pLeader];
    }
    if(job2 == job)
    {
    SendClientMessage(i, COLOR_RED, string);
    }
    }
    format(string, sizeof(string), "Dieses Gebiet bleibt in eurem Besitz, der Angreifer ist gestorben!");
    for(new i; i<MAX_PLAYERS; i++)
    {
    if(PlayerInfo[i][pMember] >0)
    {
    job2 = PlayerInfo[i][pMember];
    }
    else if(PlayerInfo[i][pLeader] >0)
    {
    job2 = PlayerInfo[i][pLeader];
    }
    if(GangZones[TakeOver[playerid]][owner] == job2)
    {
    SendClientMessage(i, COLOR_GREEN, string);
    }
    }
    TakeOver[playerid] = 255;
    TakeOverTime[playerid] = 0;
    }


    C:\Users\Daniel\Documents\Scripte\Ordner\gamemodes\BWG.pwn(7812) : error 035: argument type mismatch (argument 2)
    C:\Users\Daniel\Documents\Scripte\Ordner\gamemodes\BWG.pwn(7814) : error 035: argument type mismatch (argument 2)