Beiträge von SkaterDenis

    Ist es möglich ein automatisches RCON Login zu machen?


    Es sollte beim ersten /rcon login die ip speichern und wen der spieler off geht und dan wieder on soll es ip abfragen wenn es dieselbe ist soll man auto. als rcon Admin eingeloggt werden!

    Achso jetzt habe ichs! GetPlayerColor geht einfach standart nicht desswegen waren die farben falsch... http://wiki.sa-mp.com/wiki/GetPlayerColor und http://wiki.sa-mp.com/wiki/ColorFix


    ich habe das teil hier aus dem link reinkopiert und dan gings!


    Naja hier die anleitung um PlayerMarkers für z.b. Welt 2 Auszumachen:



    //Ganz Oben
    new ChatColors[MAX_PLAYERS];


    new PlayerColors[200] = {
    0xFF8C13FF,0xC715FFFF,0x20B2AAFF,0xDC143CFF,0x6495EDFF,0xf0e68cFF,0x778899FF,0xFF1493FF,0xF4A460FF,
    0xEE82EEFF,0xFFD720FF,0x8b4513FF,0x4949A0FF,0x148b8bFF,0x14ff7fFF,0x556b2fFF,0x0FD9FAFF,0x10DC29FF,
    0x534081FF,0x0495CDFF,0xEF6CE8FF,0xBD34DAFF,0x247C1BFF,0x0C8E5DFF,0x635B03FF,0xCB7ED3FF,0x65ADEBFF,
    0x5C1ACCFF,0xF2F853FF,0x11F891FF,0x7B39AAFF,0x53EB10FF,0x54137DFF,0x275222FF,0xF09F5BFF,0x3D0A4FFF,
    0x22F767FF,0xD63034FF,0x9A6980FF,0xDFB935FF,0x3793FAFF,0x90239DFF,0xE9AB2FFF,0xAF2FF3FF,0x057F94FF,
    0xB98519FF,0x388EEAFF,0x028151FF,0xA55043FF,0x0DE018FF,0x93AB1CFF,0x95BAF0FF,0x369976FF,0x18F71FFF,
    0x4B8987FF,0x491B9EFF,0x829DC7FF,0xBCE635FF,0xCEA6DFFF,0x20D4ADFF,0x2D74FDFF,0x3C1C0DFF,0x12D6D4FF,
    0x48C000FF,0x2A51E2FF,0xE3AC12FF,0xFC42A8FF,0x2FC827FF,0x1A30BFFF,0xB740C2FF,0x42ACF5FF,0x2FD9DEFF,
    0xFAFB71FF,0x05D1CDFF,0xC471BDFF,0x94436EFF,0xC1F7ECFF,0xCE79EEFF,0xBD1EF2FF,0x93B7E4FF,0x3214AAFF,
    0x184D3BFF,0xAE4B99FF,0x7E49D7FF,0x4C436EFF,0xFA24CCFF,0xCE76BEFF,0xA04E0AFF,0x9F945CFF,0xDCDE3DFF,
    0x10C9C5FF,0x70524DFF,0x0BE472FF,0x8A2CD7FF,0x6152C2FF,0xCF72A9FF,0xE59338FF,0xEEDC2DFF,0xD8C762FF,
    0xD8C762FF,0xFF8C13FF,0xC715FFFF,0x20B2AAFF,0xDC143CFF,0x6495EDFF,0xf0e68cFF,0x778899FF,0xFF1493FF,
    0xF4A460FF,0xEE82EEFF,0xFFD720FF,0x8b4513FF,0x4949A0FF,0x148b8bFF,0x14ff7fFF,0x556b2fFF,0x0FD9FAFF,
    0x10DC29FF,0x534081FF,0x0495CDFF,0xEF6CE8FF,0xBD34DAFF,0x247C1BFF,0x0C8E5DFF,0x635B03FF,0xCB7ED3FF,
    0x65ADEBFF,0x5C1ACCFF,0xF2F853FF,0x11F891FF,0x7B39AAFF,0x53EB10FF,0x54137DFF,0x275222FF,0xF09F5BFF,
    0x3D0A4FFF,0x22F767FF,0xD63034FF,0x9A6980FF,0xDFB935FF,0x3793FAFF,0x90239DFF,0xE9AB2FFF,0xAF2FF3FF,
    0x057F94FF,0xB98519FF,0x388EEAFF,0x028151FF,0xA55043FF,0x0DE018FF,0x93AB1CFF,0x95BAF0FF,0x369976FF,
    0x18F71FFF,0x4B8987FF,0x491B9EFF,0x829DC7FF,0xBCE635FF,0xCEA6DFFF,0x20D4ADFF,0x2D74FDFF,0x3C1C0DFF,
    0x12D6D4FF,0x48C000FF,0x2A51E2FF,0xE3AC12FF,0xFC42A8FF,0x2FC827FF,0x1A30BFFF,0xB740C2FF,0x42ACF5FF,
    0x2FD9DEFF,0xFAFB71FF,0x05D1CDFF,0xC471BDFF,0x94436EFF,0xC1F7ECFF,0xCE79EEFF,0xBD1EF2FF,0x93B7E4FF,
    0x3214AAFF,0x184D3BFF,0xAE4B99FF,0x7E49D7FF,0x4C436EFF,0xFA24CCFF,0xCE76BEFF,0xA04E0AFF,0x9F945CFF,
    0xDCDE3DFF,0x10C9C5FF,0x70524DFF,0x0BE472FF,0x8A2CD7FF,0x6152C2FF,0xCF72A9FF,0xE59338FF,0xEEDC2DFF,
    0xD8C762FF,0xD8C762FF
    };


    //GameModeInt
    ShowPlayerMarkers(1);


    //OnPlayerConnect
    SetPlayerColor(playerid, PlayerColors[playerid]);
    ChatColors[playerid] = GetPlayerColor(playerid);


    //Player geht in Welt 2
    ChatColors[playerid] = GetPlayerColor(playerid);
    SetPlayerVirtualWorld(playerid, 2);
    SetPlayerColor(playerid,0xFFFFFF00);
    for (new i = 0; i < MAX_PLAYERS; i++) if (GetPlayerVirtualWorld(i) == 2) SetPlayerMarkerForPlayer( playerid, i, 0xFFFFFF00 );
    for (new i = 0; i < MAX_PLAYERS; i++) if (GetPlayerVirtualWorld(i) == 2) SetPlayerMarkerForPlayer( i, playerid, 0xFFFFFF00 );


    //Player geht aus Welt 2 in Welt 0 (Welt 0 ist Standart)
    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerColor(playerid,ChatColors[playerid]);
    for (new i = 0; i < MAX_PLAYERS; i++) if (GetPlayerVirtualWorld(i) == 0) SetPlayerMarkerForPlayer( playerid, i, ChatColors[i] );


    //OnPlayerSpawn(playerid)
    if (GetPlayerVirtualWorld(playerid) == 2)
    {
    SetPlayerColor(playerid,0xFFFFFF00);
    for (new i = 0; i < MAX_PLAYERS; i++) if (GetPlayerVirtualWorld(i) == 2) SetPlayerMarkerForPlayer( playerid, i, 0xFFFFFF00 );
    for (new i = 0; i < MAX_PLAYERS; i++) if (GetPlayerVirtualWorld(i) == 2) SetPlayerMarkerForPlayer( i, playerid, 0xFFFFFF00 );
    }
    else
    {
    ...

    Hallo erstmal^^


    Also mein Ziel ist es grade die PlayerMarkers in Virtuellen Welt 2 auszumachen (das hat geklappt) nur das wen die spieler wieder in ne anderen Virtuellen Welten gehen sollen die wieder als marker angezeigt werden und ihre Farbe die sie befor sie in welt 2 gegangen sind wiederkrigen! welt 2 is bei mir dm

    //GameModeInt
    ShowPlayerMarkers(1);


    //Player geht in DM
    SetPlayerVirtualWorld(playerid, 2);
    for (new i = 0; i < MAX_PLAYERS; i++) SetPlayerMarkerForPlayer( playerid, i, 0xFFFFFF00 ); //So das klappt nur komischerweise ändert sich chat Farbe auch...


    //Player geht aus DM
    SetPlayerVirtualWorld(playerid, 0);
    Was soll man machen damit sie hier ihre alten farben wieder kriegen?


    Geht das vileicht iregendwie so?

    new ChatColors[MAX_PLAYERS];


    //GameModeInt
    ShowPlayerMarkers(1);


    //OnPlayerConnect
    ChatColors[playerid] = GetPlayerColor(playerid);


    //Player geht in DM
    ChatColors[playerid] = GetPlayerColor(playerid);
    SetPlayerVirtualWorld(playerid, 2);
    for (new i = 0; i < MAX_PLAYERS; i++) SetPlayerMarkerForPlayer( playerid, i, 0xFFFFFF00 );


    //Player geht aus DM
    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerColor(playerid,ChatColors[playerid]);
    for (new i = 0; i < MAX_PLAYERS; i++) SetPlayerMarkerForPlayer( playerid, i, ChatColors[i] );

    Hallo^^


    Ich wollte mal fragen wie man das machen kann das man einen Befehl der ein Waffenmenu erstellt nur 15 sec nachdem du gespawnt bist benutzbar ist?!?


    Es geht nähmlich darum das wen ein spieler in dm stirbt und dan neu spawn kann er nur 15 sec lang in den Weapon Shop sich Waffen kaufen... Also CCS like...

    Achso ok THX Und sonst in dem DM score alles richtig?


    Jetzt Gehts
    Habes es so:

    for (new i = 0; i < MAX_PLAYERS; i++) TextDrawSetString(stats[i],s);


    //Edit ups da war noch ein kleiner Fehler oben habe gefixt jetzt is oben alles richtig (der dm score^^)


    Und hier die DM stats^^

    if(strcmp(cmdtext, "/dmstats", true) == 0)
    {
    if (GetPlayerVirtualWorld(playerid) == 2)
    {
    new strtmp[100];
    SendClientMessage(playerid,0x0096FFFF,"Player DM Stats:");
    for(new i = 0; i <MAX_PLAYERS; i++)
    {
    if (GetPlayerVirtualWorld(i) == 2)
    {
    GetPlayerName(i,strtmp,sizeof(strtmp));
    format(strtmp,sizeof(strtmp),"%s Deaths: %d, Kills: %d",strtmp,sstats0[i], sstats1[i]);
    SendClientMessage(playerid,0x00FFFFFF,strtmp);
    }
    }
    }
    else
    {
    SendClientMessage(playerid,COLOR_RED,"You cant use this command here!");
    }
    return 1;
    }

    Ich habe es mal komplett bearbeitet und jetzt geht fast alles einwandfei!



    //Ganz Oben
    new sstats0[MAX_PLAYERS],sstats1[MAX_PLAYERS],sstats2;//, Text:stats;
    new Text:stats[MAX_PLAYERS];


    //DM
    sstats2++;
    new s[100];
    format(s,sizeof(s),"Deaths: %d, Kills: %d, in DM: %d",sstats0[playerid], sstats1[playerid], sstats2);
    for (new i = 0; i < MAX_PLAYERS; i++) TextDrawSetString(stats[i],s);
    TextDrawSetString(stats[playerid],s);
    TextDrawShowForPlayer(playerid,stats[playerid]);


    //LeaveDM
    sstats2--; //DM Score -1 in Leute in DM
    new s[100];
    format(s,sizeof(s),"Deaths: %d, Kills: %d, in DM: %d",sstats0[playerid], sstats1[playerid], sstats2);
    for (new i = 0; i < MAX_PLAYERS; i++) TextDrawSetString(stats[i],s);
    TextDrawSetString(stats[playerid],s);
    TextDrawHideForPlayer(playerid,stats[playerid]);


    //OnPlayerConnect
    stats[playerid]=TextDrawCreate(392,103,"Deaths: 0, Kills: 0, in DM: 0"); //DM stats
    sstats0[playerid] = 0;
    sstats1[playerid] = 0;


    //OnPlayerDisconnect
    TextDrawDestroy(stats[playerid]);
    sstats2--;
    new s[100];
    for (new i = 0; i < MAX_PLAYERS; i++) format(s,sizeof(s),"Deaths: %d, Kills: %d, in DM: %d",sstats0[i], sstats1[i], sstats2);
    for (new i = 0; i < MAX_PLAYERS; i++) TextDrawSetString(stats[i],s);
    TextDrawSetString(stats[playerid],s);


    //OnPlayerDeath
    if SpielerInDM...
    {
    if(killerid == INVALID_PLAYER_ID)
    {
    sstats0[playerid]++;
    new s[100];
    format(s,sizeof(s),"Deaths: %d, Kills: %d, in DM: %d",sstats0[playerid], sstats1[playerid], sstats2);
    TextDrawSetString(stats[playerid],s);
    SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
    }
    else
    {
    sstats0[playerid]++;
    new s0[100];
    format(s0,sizeof(s0),"Deaths: %d, Kills: %d, in DM: %d",sstats0[playerid], sstats1[playerid], sstats2);
    TextDrawSetString(stats[playerid],s0);
    sstats1[killerid]++;
    new s1[100];
    format(s1,sizeof(s1),"Deaths: %d, Kills: %d, in DM: %d",sstats0[killerid], sstats1[killerid], sstats2);
    TextDrawSetString(stats[killerid],s1);
    SendDeathMessage(killerid,playerid,reason);


    //OnGameModeExit
    for (new i = 0; i < MAX_PLAYERS; i++) sstats0[i] = 0;
    for (new i = 0; i < MAX_PLAYERS; i++) sstats1[i] = 0;
    sstats2 = 0;


    Doch da ist ein bug!


    Wenn ich z.b. in dm bin(alleine) und mach /free dan wird ja "in dm" -1 gerechnet also komm ich auf 0 das ist richtig! Funktioniert auch!
    Aber wenn ich in dm bin und mich jaile und somit auch aus dm komme dan weis ich nicht was passiert denn wen ich wieder in DM reingehe steht dann bei "In DM" -198 obwohl es eig 0 sein müsste... Woran liegt das=?
    Hier mein Jail Befehl:



    /*if (!strcmp(cmd, "/jail", true)) {
    new tmp[128];
    tmp = strtok(cmdtext, index);
    if (!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GREEN, "USAGE: /jail [playerid]");
    return 1;
    }
    if (!IsPlayerAdmin(playerid))
    {
    SendClientMessage(playerid,COLOR_RED,"You aren't Admin!");
    return 1;
    }
    new id = strval(tmp);
    if (!(IsPlayerConnected(id)))
    {
    SendClientMessage(playerid,COLOR_RED,"That player doesn't exist!");
    return 1;
    }
    if (GetPlayerVirtualWorld(id) == 4)
    {
    SendClientMessage(playerid,COLOR_RED,"This player is already jailed!");
    return 1;
    }*/
    if (GetPlayerVirtualWorld(id) == 2) { //Ist bei mir DM
    for (new i = 0; i < MAX_PLAYERS; i++) {
    sstats2--; //DM Score -1 in Leute in DM
    new s[100];
    format(s,sizeof(s),"Deaths: %d, Kills: %d, in DM: %d",sstats0[playerid], sstats1[playerid], sstats2);
    TextDrawSetString(stats[i],s);
    TextDrawSetString(stats[id],s);
    TextDrawSetString(stats[playerid],s);
    TextDrawHideForPlayer(id,stats[id]); } //DM Score Schliesen
    /*GetPlayerName(id, IDName, sizeof(IDName));
    format(tmp, sizeof(tmp), "You have jailed %s (ID:%d)",IDName,id);
    SendClientMessage(playerid, 0xAA3333AA, tmp);
    SetPlayerInterior(id,0);
    SetPlayerVirtualWorld(id, 4);
    SetVehicleVirtualWorld(GetPlayerVehicleID(id), 4);
    SetPlayerPos(id,2384.0,-1451.6,3.5);
    SetPlayerFacingAngle(id, 220.0);
    SetCameraBehindPlayer(id);
    SetPlayerArmour(id,0);
    ResetPlayerWeapons(id);
    GetPlayerName(playerid, AdminName, sizeof(AdminName));
    format(tmp, sizeof(tmp), "jailed by %s",AdminName);
    GameTextForPlayer(id, tmp, 1000,1);
    SetPlayerHealth(id,100.0);
    SetVehicleHealth(GetPlayerVehicleID(id), 1000.0);
    KillTimer(GTimer);
    Knast = CreatePlayerObject(id, 5700, 2386.8, -1452.7, 4.1802, 0.0, 0.0, 180.0);
    }
    return 1;
    }*/