CreateEventPickup problem

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 leute ich wollte mir ein dynamic event system machen mit pickups.
    doch wenn ich den cmd eingebe kommt nix und server geht aus.
    kann jemand vil den code ansehen und korrigieren falls falsch?


    enum epickup
    {
    Name[20],
    Cash,
    health,
    armour,
    weapon,
    ammo,
    score,
    Float:x_pos,
    Float:y_pos,
    Float:z_pos,
    active,
    world
    }
    new EventPickup[MAX_PICKUPS][epickup];


    stock CreateEventPickup(playerid, pname, phealth, parmour, pcash, pscore, pweaponid, pweaponammo)
    {
    new Float:pos[3],s[50];
    print("DEBUG: Float");
    new Welt = GetPlayerVirtualWorld(playerid);
    print("DEBUG: VirtualWorld");
    GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
    print("DEBUG: Position");
    new Pickup = CreatePickup(1582,1,pos[0],pos[1],pos[2],Welt);
    print("DEBUG: Pickup erstellen");
    EventPickup[Pickup][world] = Welt;
    print("DEBUG: Welt speichern");
    EventPickup[Pickup][x_pos] = pos[0];
    EventPickup[Pickup][y_pos] = pos[1];
    EventPickup[Pickup][z_pos] = pos[2];
    print("DEBUG: Coords speichern");
    format(EventPickup[Pickup][Name],20,"%s",pname);
    print("DEBUG: Name Speichern");
    EventPickup[Pickup][health] = phealth;
    print("DEBUG: health");
    EventPickup[Pickup][armour] = parmour;
    print("DEBUG: armour");
    EventPickup[Pickup][Cash] = pcash;
    print("DEBUG: cash");
    EventPickup[Pickup][score] = pscore;
    print("DEBUG: score");
    EventPickup[Pickup][weapon] = pweaponid;
    print("DEBUG: weaponid");
    EventPickup[Pickup][ammo] = pweaponammo;
    print("DEBUG: weaponammo");
    SetPlayerPos(playerid,pos[0]+5,pos[1]+5,pos[2]+10);
    format(s,sizeof s,"Event Pickup Name = %d",EventPickup[Pickup][Name]);
    SendClientMessage(playerid,Color_AdmCmd,s);
    format(s,sizeof s,"Event Pickup World = %d",EventPickup[Pickup][world]);
    SendClientMessage(playerid,Color_AdmCmd,s);
    format(s,sizeof s,"Event Pickup Health: %d | Armour: %d",EventPickup[Pickup][health],EventPickup[Pickup][armour]);
    SendClientMessage(playerid,Color_AdmCmd,s);
    format(s,sizeof s,"Event Pickup Weaponid: %d | ammo: %d",EventPickup[Pickup][weapon],EventPickup[Pickup][ammo]);
    SendClientMessage(playerid,Color_AdmCmd,s);
    format(s,sizeof s,"Event Pickup Cash: %d | Score: %d",EventPickup[Pickup][Cash],EventPickup[Pickup][score]);
    SendClientMessage(playerid,Color_AdmCmd,s);
    SendClientMessageToAll(Color_AdmCmd,"[EVENT] Event Pickup has been created. Find it and you get some Prices!");
    return 1;
    }


    CMD:createeventpickup(playerid,params[])
    {
    new oname, ohealth, oarmour, ocash, oscore, oweaponid, oweaponammo;
    if(Acc[playerid][Adminlevel] <5) return SendClientMessage(playerid,COLOR_RED,"You cannot use this Command");
    else if(sscanf(params,"sdddddd", oname, ohealth, oarmour, ocash, oscore, oweaponid, oweaponammo)) return SendClientMessage(playerid,COLOR_RED,"Usage: /createeventpickup <name> <Health> <Armour> <Cash> <Score> <weaponid> <weaponammo>");
    else
    {
    print("DEBUG: Starten...");
    CreateEventPickup(playerid, oname, ohealth, oarmour, ocash, oscore, oweaponid, oweaponammo);
    }
    return 1;
    }


    ps: ich benutze zcmd


    EDIT: DEBUG: Starte... wird nicht in den logs angezeigt

  • lol dummheit von mir ^^ ich change und teste edit kommt gleich


    EDIT: [14:25:39] DEBUG: Starten...
    [14:25:39] DEBUG: Float
    [14:25:39] DEBUG: VirtualWorld
    [14:25:39] DEBUG: Position
    [14:25:39] DEBUG: Pickup erstellen
    [14:25:39] DEBUG: Welt speichern
    [14:25:39] DEBUG: Coords speichern
    [14:25:39] DEBUG: Name Speichern
    [14:25:39] DEBUG: health
    [14:25:39] DEBUG: armour
    [14:25:39] DEBUG: cash
    [14:25:39] DEBUG: score
    [14:25:39] DEBUG: weaponid
    [14:25:39] DEBUG: weaponammo


    und server crash ? einer eine idee ?

  • nein master...
    print = ausgabe eines nicht dynamischen textes.
    printf = ausgabe eines dynamischen textes also mit variablen einfügen (%s / %d etc.)