Beiträge von Daniel_Waynee

    Speichern soll er in dem der Leader ihn setzt.



    Und das Abfragen kommt durchs laden.


    public OnFrakLoad()
    {
    new num_fields,num_rows;
    cache_get_data(num_rows,num_fields,handle);
    if(!num_rows)return 1;
    for(new i = 0;i<num_rows;i++)
    {
    new id=getFreeFrakID();
    //NAME
    new tmp_name[35];
    cache_get_field_content(i,"Name",tmp_name,handle);
    strmid(fInfo[id][f_name],tmp_name,0,sizeof(tmp_name),sizeof(tmp_name));
    //X
    fInfo[id][f_spawnX] = cache_get_field_content_float(i,"spawnX",handle);
    //Y
    fInfo[id][f_spawnY] = cache_get_field_content_float(i,"spawnY",handle);
    //Z
    fInfo[id][f_spawnZ] = cache_get_field_content_float(i,"spawnZ",handle);
    //R
    fInfo[id][f_spawnR] = cache_get_field_content_float(i,"spawnR",handle);
    //INT
    fInfo[id][f_int] = cache_get_field_content_int(i,"Interior",handle);
    //WORLD
    fInfo[id][f_world] = cache_get_field_content_int(i,"World",handle);
    //ID
    fInfo[id][f_id] = cache_get_field_content_int(i,"id",handle);
    //SKIN
    fInfo[id][f_skin] = cache_get_field_content_int(i,"Skin",handle);
    //RANKE
    cache_get_field_content(i,"f_Rank1",tmp_name,handle);
    strmid(fInfo[id][f_Rank1],tmp_name,0,sizeof(tmp_name),sizeof(tmp_name));
    cache_get_field_content(i,"f_Rank2",tmp_name,handle);
    strmid(fInfo[id][f_Rank2],tmp_name,0,sizeof(tmp_name),sizeof(tmp_name));
    cache_get_field_content(i,"f_Rank3",tmp_name,handle);
    strmid(fInfo[id][f_Rank3],tmp_name,0,sizeof(tmp_name),sizeof(tmp_name));
    cache_get_field_content(i,"f_Rank4",tmp_name,handle);
    strmid(fInfo[id][f_Rank4],tmp_name,0,sizeof(tmp_name),sizeof(tmp_name));
    cache_get_field_content(i,"f_Rank5",tmp_name,handle);
    strmid(fInfo[id][f_Rank5],tmp_name,0,sizeof(tmp_name),sizeof(tmp_name));
    cache_get_field_content(i,"f_Rank6",tmp_name,handle);
    strmid(fInfo[id][f_Rank6],tmp_name,0,sizeof(tmp_name),sizeof(tmp_name));
    cache_get_field_content(i,"f_Rank7",tmp_name,handle);
    strmid(fInfo[id][f_Rank7],tmp_name,0,sizeof(tmp_name),sizeof(tmp_name));
    cache_get_field_content(i,"f_Rank8",tmp_name,handle);
    strmid(fInfo[id][f_Rank8],tmp_name,0,sizeof(tmp_name),sizeof(tmp_name));
    cache_get_field_content(i,"f_Rank9",tmp_name,handle);
    strmid(fInfo[id][f_Rank9],tmp_name,0,sizeof(tmp_name),sizeof(tmp_name));
    cache_get_field_content(i,"f_Rank10",tmp_name,handle);
    strmid(fInfo[id][f_Rank10],tmp_name,0,sizeof(tmp_name),sizeof(tmp_name));
    cache_get_field_content(i,"f_Rank11",tmp_name,handle);
    strmid(fInfo[id][f_Rank11],tmp_name,0,sizeof(tmp_name),sizeof(tmp_name));
    cache_get_field_content(i,"f_Rank12",tmp_name,handle);
    strmid(fInfo[id][f_Rank12],tmp_name,0,sizeof(tmp_name),sizeof(tmp_name));
    printf("Name: %s | ID: %i",fInfo[id][f_Rank9],fInfo[id][f_id]);
    }
    return 1;
    }

    Hallo ich wollte ein Befehl machen mit dem man von seiner Fraktion die Rank Namen ändern kann Z.B.S /setfrank [Rank 1-12] [Rangname]


    nur jetzt weiß ich nicht wie ich es machen kann das er wenn er rank 1 eingibt das nur er geändert wird.


    HIER DER BEFEHL:


    ocmd:setfrank(playerid,params[])
    {
    new rID,name[50];
    if(sInfo[playerid][Rank] < 11)return SendClientMessage(playerid,rot,"Du bist nicht der Leader");
    if(sscanf(params,"is[50]",rID,name)) return SendClientMessage(playerid,rot,"Verwendung: /setfrank [Rank 1-12] [Name]");
    new query[500];
    new message[250];
    format(message,sizeof(message),"Du hast den Name von Rank: %i in %s geändert.",rID,name);
    SendClientMessage(playerid,grün,message);
    return 1;
    }

    Hallo wenn ich /tor eingebe öffnet sich mein Tor aber es Schließt sich nicht mehr mit /tor.


    HIER DER CODE;


    ocmd:tor(playerid,params[])
    {
    new pdtor[1];
    if(IsPlayerInRangeOfPoint(playerid,3,1559.94995, -1677.82996, 1722.09998))
    {
    if(sInfo[playerid][Fraktion] != 1)return 1;
    if(pdtor[0] == 0)
    {
    MoveDynamicObject(LSPD[0],1558.6500, -1677.8300, 1722.1000,5,0,0,0);
    pdtor[0] = 1;
    }
    else
    {
    MoveDynamicObject(LSPD[0],1559.94995, -1677.82996, 1722.09998,5,0,0,0);
    pdtor[0] = 0;
    return 1;
    }
    }
    return 1;
    }

    Hallo wenn ich die Spawns der Fraktionen aus der Datenbank lesen will geht es aber er Spawn mich immer am 0 Punkt.


    Hier der CODE:


    ENUM:
    enum fracEnum {


    f_id,
    f_name[128],
    Float:f_spawnX,
    Float:f_spawnY,
    Float:f_spawnZ,
    Float:f_spawnR,
    f_int,
    f_world
    }


    OnFrakLoad:
    public OnFrakLoad()
    {
    new num_fields,num_rows;
    cache_get_data(num_rows,num_fields,handle);
    if(!num_rows)return 1;
    for(new i = 0;i<num_rows;i++)
    {
    new id=getFreeFrakID();
    //NAME
    new tmp_name[35];
    cache_get_field_content(i,"Name",tmp_name,handle);
    strmid(fInfo[id][f_name],tmp_name,0,sizeof(tmp_name),sizeof(tmp_name));
    //X
    fInfo[id][f_spawnX] = cache_get_field_content_float(i,"spawnX",handle);
    //Y
    fInfo[id][f_spawnY] = cache_get_field_content_float(i,"spawnY",handle);
    //Z
    fInfo[id][f_spawnZ] = cache_get_field_content_float(i,"spawnZ",handle);
    //R
    fInfo[id][f_spawnR] = cache_get_field_content_float(i,"spawnR",handle);
    //INT
    fInfo[id][f_int] = cache_get_field_content_int(i,"Interior",handle);
    //WORLD
    fInfo[id][f_world] = cache_get_field_content_int(i,"World",handle);
    //ID
    fInfo[id][f_id] = cache_get_field_content_int(i,"id",handle);



    printf("Name: %s",fInfo[id][f_name]);
    }


    return 1;
    }


    getFreeFrakID:


    getFreeFrakID()
    {
    for(new i=0;i< sizeof(fInfo); i++)
    {
    if(fInfo[i][f_id]== 0) return i;
    }
    return 0;
    }


    OnPlayerSpawn:
    public OnPlayerSpawn(playerid)
    {
    new frak = sInfo[playerid][Fraktion];
    if(frak == 0)
    {
    //ZIVILIST
    SetPlayerPos(playerid,2031.5146,1343.5313,10.8203);
    SetPlayerFacingAngle(playerid,270.0591);
    return 1;
    }
    else
    {
    //FRAKTION
    SetPlayerPos(playerid,fInfo[frak][f_spawnX],fInfo[frak][f_spawnY],fInfo[frak][f_spawnZ]);
    SetPlayerFacingAngle(playerid,fInfo[frak][f_spawnR]);
    SetPlayerInterior(playerid,fInfo[frak][f_int]);
    SetPlayerVirtualWorld(playerid,fInfo[frak][f_world]);
    }
    ClearChat(playerid);
    return 1;
    }

    Probiers mal so


    • Du Speicherst nur die Spieler und schreibst das er neugestartet wird
    • Machs so

    Hast du denn auch bei der abfrage die Virtualworld geändert also so?


    • if(GetPlayerVirtualWorld(playerid) != 2)return 1;//HITMAN BASE
    • if(GetPlayerVirtualWorld(playerid) != 3)return 1;//Groove BASE
    Code
    if(IsPlayerInRangeOfPoint(playerid,3,2807.5945,-1174.7563,1025.5703))
    {
       if(!GetPlayerVirtualWorld(playerid,1))return 1;
       SetPlayerInterior(playerid, 0);
       SetPlayerPos(playerid,1085.0936,-1226.3617,15.8203);
       SetPlayerVirtualWorld(playerid,0);
       SetCameraBehindPlayer(playerid);
       SetPlayerFacingAngle(playerid,90);
       SendClientMessage(playerid,ROT,"Du hast die Ballas Base verlassen!");
    }

    Wenn du mehrfach das gleiche interior verwenden willst musst du beim rausgehen abfragen ob er in dieser Virtuelworld ist.



    [list=1][*]if(IsPlayerInRangeOfPoint(playerid,3,2807.5945,-1174.7563,1025.5703))
    [*]{
    [*]if(!GetPlayerVirtualWorld(playerid,1))return 1;
    [*]SetPlayerInterior(playerid, 0);
    [*]SetPlayerPos(playerid,1085.0936,-1226.3617,15.8203);
    [*]SetPlayerVirtualWorld(playerid,0);
    [*]SetCameraBehindPlayer(playerid);
    [*]SetPlayerFacingAngle(playerid,90);
    [*]SendClientMessage(playerid,ROT,"Du hast die Ballas Base verlassen!");
    [*]}
    [/list]

    Hallo ich wollte machen das man beim PayDay den Lohn auf der Bank bekommt alles funktioniert aber nicht das der Lohn auf der Bank ist.



    CODE:

    Code
    pInfo[playerid][Lohn] += pInfo[playerid][BankGeld];