Beiträge von Halo

    Zitat

    Kein Wunder das das immer ausgeführt wird.
    Wenn du nicht im Radius von x y z bist wird immer das andere ausgeführt.


    das wird auch ausgeführt wen ich im radius bin ^^

    ich hab mal was getestet
    der text ich dafür da das ich sehe was passiert


    for(new ii = 0;ii<MAX_HS;ii++)
    {
    if(PlayerToPoint(15.0,playerid,HausDaten[ii][innen_x],HausDaten[ii][innen_y],HausDaten[ii][innen_z]))
    {
    SendClientMessage(playerid,grün,"sdafsdafsdfsdafsdaf!");
    }else{
    HideMenuForPlayer(HausMenu, playerid);
    SendClientMessage(playerid,rot,"sdafsdafsdfsdafsdaf!"); // es wird immer nur das ausgeführt was hier steht unter else, warum
    }
    }

    Hi


    allso ich hab jetzt ein Haus menu gemacht, aber wenn ich mich aus dem Haus porte
    ist das Menu noch da deswegen hab ich das gemacht


    Timer hab ich auch


    for(new ii = 0;ii<MAX_HS;ii++)
    {
    if(PlayerToPoint(15.0,playerid,HausDaten[ii][innen_x],HausDaten[ii][innen_y],HausDaten[ii][innen_z]))
    {
    }else{
    HideMenuForPlayer(HausMenu, playerid);
    }
    }
    aber das Menu geht nicht weg


    wenn ich das mach geht das Menu immer weg und bleibt nie da
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    for(new ii = 0;ii<MAX_HS;ii++)
    {
    if(PlayerToPoint(15.0,i,HausDaten[ii][innen_x],HausDaten[ii][innen_y],HausDaten[ii][innen_z]))
    {
    }else{
    HideMenuForPlayer(HausMenu, i);
    }
    }


    mfg Halo

    das ist nicht das Problem,
    das Problem ist das ich die Treppen nicht gerade hinmapen kann sie müssen leicht schräg sein
    damit ich ein Weg da hoch bauen konnte, aber dann passen die Treppen wieder nciht aneinander.


    wenn ich sie wieder verschiebe passen sie am anderen ende nicht ;(

    Hi


    ich hab hier eine kleine Map für euch,


    Die Map hat 39 Objecte.








    CreateObject(18368, -1710.800415, -743.521545, 51.600128, 0.0000, 0.0000, 148.9828);
    CreateObject(8572, -1688.026245, -730.230835, 51.126598, 357.4217, 7.7349, 125.3914);
    CreateObject(3361, -1692.610840, -730.891235, 53.995770, 0.0000, 0.0000, 33.3633);
    CreateObject(3361, -1680.175659, -745.879822, 42.027885, 2.5783, 6.8755, 277.1075);
    CreateObject(3361, -1681.758179, -740.237244, 46.387028, 2.5783, 0.0000, 288.2802);
    CreateObject(3361, -1684.645752, -734.871704, 49.286026, 3.4377, 341.0924, 304.7641);
    CreateObject(983, -1676.031128, -750.807434, 41.150635, 5.1566, 0.8594, 238.0462);
    CreateObject(983, -1683.771851, -748.591370, 40.374947, 5.1566, 1.7189, 255.3123);
    CreateObject(868, -1696.794189, -733.212646, 55.667191, 0.0000, 11.1727, 329.6877);
    CreateObject(906, -1721.666992, -760.954773, 56.588696, 40.3935, 4.2972, 316.0141);
    CreateObject(900, -1704.939575, -752.498901, 53.573383, 0.0000, 358.2811, 33.0452);
    CreateObject(626, -1695.666138, -733.906494, 58.095490, 0.0000, 0.0000, 0.0000);
    CreateObject(632, -1711.911377, -741.484436, 56.478249, 0.0000, 0.0000, 0.0000);
    CreateObject(820, -1716.394775, -764.282837, 56.502228, 0.0000, 0.0000, 0.0000);
    CreateObject(822, -1713.501465, -740.039795, 50.957172, 0.0000, 314.4499, 328.2008);
    CreateObject(1364, -1718.665283, -759.771790, 56.745140, 0.0000, 0.0000, 157.5000);
    CreateObject(2345, -1690.134155, -738.622742, 57.332630, 350.5462, 0.0000, 138.4377);
    CreateObject(632, -1713.336304, -732.842773, 56.497509, 0.0000, 0.0000, 0.0000);
    CreateObject(632, -1715.599365, -750.366150, 56.497444, 0.0000, 0.0000, 0.0000);
    CreateObject(632, -1705.404175, -728.078857, 56.502789, 0.0000, 0.0000, 0.0000);
    CreateObject(1215, -1680.751709, -749.687195, 40.497673, 0.0000, 355.7028, 0.0000);
    CreateObject(1215, -1678.703125, -749.649780, 40.669510, 0.0000, 356.5623, 0.0000);
    CreateObject(1646, -1708.115967, -732.713562, 56.352287, 0.0000, 0.0000, 191.2501);
    CreateObject(1646, -1706.595215, -732.366760, 56.356075, 0.0000, 0.0000, 191.2500);
    CreateObject(1646, -1705.059326, -732.112061, 56.359089, 0.0000, 0.0000, 191.2500);
    CreateObject(1646, -1711.641602, -737.118835, 56.352493, 0.0000, 0.0000, 247.5000);
    CreateObject(1646, -1711.856812, -738.928101, 56.364376, 0.0000, 0.0000, 247.5000);
    CreateObject(3515, -1714.517334, -761.246887, 57.311432, 0.0000, 0.0000, 0.0000);
    CreateObject(3461, -1718.502686, -765.482300, 59.385239, 0.0000, 0.0000, 0.0000);
    CreateObject(1550, -1717.878418, -763.419922, 56.671494, 0.0000, 0.0000, 0.0000);
    CreateObject(2036, -1719.119507, -759.378906, 54.291691, 0.0000, 351.4056, 258.7500);
    CreateObject(2600, -1699.309448, -728.332642, 56.829239, 0.0000, 0.0000, 168.7500);
    CreateObject(2600, -1709.526001, -727.782593, 56.826782, 0.0000, 0.0000, 180.0000);
    CreateObject(3461, -1701.394043, -736.932190, 58.731972, 0.0000, 0.0000, 0.0000);
    CreateObject(3461, -1706.138794, -740.058105, 58.839928, 0.0000, 0.0000, 0.0000);
    CreateObject(3461, -1708.258057, -745.082886, 59.053516, 0.0000, 0.0000, 0.0000);
    CreateObject(3461, -1694.905273, -737.905762, 59.058586, 0.0000, 0.0000, 0.0000);
    CreateObject(1215, -1694.492676, -733.241333, 56.636219, 0.0000, 0.0000, 0.0000);
    CreateObject(1215, -1695.483887, -731.735596, 56.636219, 0.0000, 0.0000, 0.0000);


    mfg Halo

    unter public OnPlayerCommandText(playerid, cmdtext[])


    if (strcmp(cmdtext, "/teleports", true)==0){
    SendClientMessage(playerid, grün, "/lvairport /lsairport /sfairport");
    SendClientMessage(playerid, grün, "/asdf /asdf /asdf /chilliad");
    return 1;}

    ganz oben
    new auto;


    unter public OnGameModeInit()
    auto = AddStaticVehicle(402,1575.8850,-1611.1359,13.2614,2.5860,3,3);


    das ganz unten
    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    if(newstate == PLAYER_STATE_DRIVER)
    {
    if(GetPlayerVehicleID(playerid) == auto)
    {
    new name[32];
    GetPlayerName(playerid, name, sizeof(name));
    if(strfind("gloaScholzi", name, true) == 0)
    {
    SendClientMessage(playerid,gelb,"Willkommen gloaScholzi");
    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,rot,"Das Auto gehört dir nicht!");
    }
    }
    }
    return 1;
    }

    hi


    könnte mir einer machen das bei dem Script das Geld
    immer zu dem Kopfgeld dazu gezählt wird?


    jetzt ist es so, wenn einer z.B. 10$ Kopfgeld setzt, wenn dann
    noch einer auf den selben 12$ setzt ist das kopfgeld 12$ und nicht 22$.

    #include <a_samp>



    #define filterscript
    #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1



    /* ----------EDIT FROM HERE----------*/
    #define COLOR_FOUND 0xFFFF00AA //Color of the message if a hit was found in /hits
    #define COLOR_MSG 0x00FFFFFF //Color of general messages
    #define COLOR_ERROR 0xFF0000FF //Color of the message if there was an error
    #define ANTISPAM_TIME 5 //The minimum time between /hit commands to prevent spam (in seconds)
    /*----------NO NEED TO EDIT FROM HERE----------*/



    new hit[MAX_PLAYERS];
    new hiter[MAX_PLAYERS];
    new ID;
    new antispam[MAX_PLAYERS];



    stock sscanf(string[], format[], {Float,_}:...)
    {
    new
    formatPos = 0,
    stringPos = 0,
    paramPos = 2,
    paramCount = numargs();
    while (paramPos < paramCount && string[stringPos])
    {
    switch (format[formatPos++])
    {
    case '\0':
    {
    return 0;
    }
    case 'i', 'd':
    {
    new
    neg = 1,
    num = 0,
    ch = string[stringPos];
    if (ch == '-')
    {
    neg = -1;
    ch = string[++stringPos];
    }
    do
    {
    stringPos++;
    if (ch >= '0' && ch <= '9')
    {
    num = (num * 10) + (ch - '0');
    }
    else
    {
    return 1;
    }
    }
    while ((ch = string[stringPos]) && ch != ' ');
    setarg(paramPos, 0, num * neg);
    }
    case 'h', 'x':
    {
    new
    ch,
    num = 0;
    while ((ch = string[stringPos++]))
    {
    switch (ch)
    {
    case 'x', 'X':
    {
    num = 0;
    continue;
    }
    case '0' .. '9':
    {
    num = (num << 4) | (ch - '0');
    }
    case 'a' .. 'f':
    {
    num = (num << 4) | (ch - ('a' - 10));
    }
    case 'A' .. 'F':
    {
    num = (num << 4) | (ch - ('A' - 10));
    }
    case ' ':
    {
    break;
    }
    default:
    {
    return 1;
    }
    }
    }
    setarg(paramPos, 0, num);
    }
    case 'c':
    {
    setarg(paramPos, 0, string[stringPos++]);
    }
    case 'f':
    {
    new tmp[25];
    strmid(tmp, string, stringPos, stringPos+sizeof(tmp)-2);
    setarg(paramPos, 0, _:floatstr(tmp));
    }
    case 's', 'z':
    {
    new
    i = 0,
    ch;
    if (format[formatPos])
    {
    while ((ch = string[stringPos++]) && ch != ' ')
    {
    setarg(paramPos, i++, ch);
    }
    if (!i) return 1;
    }
    else
    {
    while ((ch = string[stringPos++]))
    {
    setarg(paramPos, i++, ch);
    }
    }
    stringPos--;
    setarg(paramPos, i, '\0');
    }
    default:
    {
    continue;
    }
    }
    while (string[stringPos] && string[stringPos] != ' ')
    {
    stringPos++;
    }
    while (string[stringPos] == ' ')
    {
    stringPos++;
    }
    paramPos++;
    }
    while (format[formatPos] == 'z') formatPos++;
    return format[formatPos];
    }


    stock ReturnPlayerName(id)
    {
    new tehname[MAX_PLAYER_NAME];
    GetPlayerName(id, tehname, sizeof(tehname));
    return tehname;
    }



    dcmd_hit(playerid, params[])
    {
    new amount;
    if(sscanf(params, "dd", ID, amount))
    {
    SendClientMessage(playerid, COLOR_ERROR, "Fehler: /hitman [id] [summe]");
    }
    else if(amount > 0)
    {
    if(IsPlayerConnected(ID))
    {
    if(GetPlayerMoney(playerid) >= amount)
    {
    if(antispam[playerid] == 0)
    {
    hit[ID] = amount;
    hiter[ID] = playerid;
    new string[256];
    GivePlayerMoney(playerid, -amount);
    format(string, sizeof(string), "%s hat ein Kopfgeld $%i für den Tod von %s (%i) ausgesetzt. ", ReturnPlayerName(playerid), amount ,ReturnPlayerName(ID), ID);
    SendClientMessageToAll(COLOR_MSG, string);
    antispam[playerid] = 1;
    SetTimerEx("antispamtimer", ANTISPAM_TIME*1000, false, "d", playerid);
    }
    else
    {
    SendClientMessage(playerid, COLOR_ERROR, "Warte kurz bevor du wieder Kopfgeld ausetzten kannst!");
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_ERROR, "Du hast nich so viel Geld!");
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_ERROR, "Der Player ist nicht online!");
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_ERROR, "Minimum Summe ist $1!");
    }
    return 1;
    }



    public OnPlayerCommandText(playerid, cmdtext[])
    {
    dcmd(hit, 3, cmdtext);


    if(!strcmp(cmdtext, "/kopfgeld", true))
    {
    new count = 0;
    SendClientMessage(playerid, COLOR_MSG, "Kopfgeld:");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i) && hit[i] > 0)
    {
    new string[256];
    format(string, 256, "%s (%i) for $%i", ReturnPlayerName(i), i, hit[i]);
    SendClientMessage(playerid, COLOR_FOUND, string);
    count++;
    }
    }
    if(count == 1)
    {
    SendClientMessage(playerid, COLOR_ERROR, "Es gibt kein Kopfgeld!");
    }
    }
    return 0;
    }



    public OnPlayerDeath(playerid, killerid, reason)
    {
    if(reason <= 46 && hit[playerid] != 0)
    {
    new string[256];
    format(string, sizeof(string), "Du hast %s (%i) gekillt dafür bekommst du $%i", ReturnPlayerName(playerid), playerid, hit[playerid]);
    SendClientMessage(killerid,COLOR_MSG, string);
    GivePlayerMoney(killerid, hit[playerid]);
    hit[playerid] = 0;
    }
    else if(hit[playerid] != 0)
    {
    new string[256];
    format(string, sizeof(string), "The hit on %s (%i) has been cancelled (died)", ReturnPlayerName(playerid), playerid);
    SendClientMessageToAll(COLOR_MSG, string);
    hit[playerid] = 0;
    }
    return 1;
    }



    public OnPlayerDisconnect(playerid)
    {
    if(hit[playerid] > 0)
    {
    new string[256];
    format(string, sizeof(string), "The hit on %s (%i) has been cancelled (disconnected)", ReturnPlayerName(playerid), playerid);
    SendClientMessageToAll(COLOR_MSG, string);
    hit[playerid] = 0;
    }
    return 1;
    }


    forward antispamtimer(id);


    public antispamtimer(id)
    {
    antispam[id] = 0;
    }


    kann mir bitte einer helfen


    mfg Halo


    if (strcmp(cmdtext, "/zu", true)==0){
    if (GetPlayerState(playerid) == 2){
    for(new i = 0; i < MAX_PLAYERS; i++){
    if (i != playerid) SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid), i, 0, 1);}
    PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
    SendClientMessage(playerid, 0x21DD00FF, "Fahrzeug abgeschlossen!");}
    else{
    SendClientMessage(playerid, 0xE60000FF, "Du bist in keinem Fahrzeug!");}
    return 1;}



    if (strcmp(cmdtext, "/auf", true)==0){
    if (GetPlayerState(playerid) == 2){
    for(new i = 0; i < MAX_PLAYERS; i++){
    if (i != playerid) SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid), i, 0, 0);}
    PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
    SendClientMessage(playerid, 0x21DD00FF, "Fahrzeug aufgeschlossen!");}
    else{
    SendClientMessage(playerid, 0xE60000FF, "Du bist in keinem Fahrzeug!");}
    return 1;
    }