DollahScore

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
  • Hey ho leute,


    ich habe ein Problem mit DollahScore und zwar, wenn ich connecte wird mein geld was ich auf der Hand habe wunderbar bei TAB auf der Score tabelle angezeigt, wenn ich allerdings geld verliere oder dazu kriege aktualisiert er es aber nicht obwohl der timer bei 30 sekunden liegt schaut selbst:


    forward DollahScoreUpdate();
    forward SyncUp();


    new synctimer;


    public DollahScoreUpdate()
    for(new i;i<MAX_PLAYERS;i++)
    SetPlayerScore(i,AccountInfo[i][Cash]);


    public OnGameModeInit()
    {
    /*DisableInteriorEnterExits();*/
    UsePlayerPedAnims();
    ShowPlayerMarkers(1);
    SetTimer("DollahScoreUpdate", 30000, 1);
    synctimer = SetTimer("SyncUp", 60000, 1);
    SetGameModeText("GangFight");

    AddPlayerClass(269,2495.3918,-1687.1588,13.5155,359.2405,0,0,0,0,0,0);//Groove Street
    AddPlayerClass(270,2495.3918,-1687.1588,13.5155,359.2405,0,0,0,0,0,0);//Groove Street
    AddPlayerClass(271,2495.3918,-1687.1588,13.5155,359.2405,0,0,0,0,0,0);//Groove Street
    AddPlayerClass(105,2495.3918,-1687.1588,13.5155,359.2405,0,0,0,0,0,0);//Groove Street
    AddPlayerClass(106,2495.3918,-1687.1588,13.5155,359.2405,0,0,0,0,0,0);//Groove Street
    AddPlayerClass(107,2495.3918,-1687.1588,13.5155,359.2405,0,0,0,0,0,0);//Groove Street
    AddPlayerClass(0,2495.3918,-1687.1588,13.5155,359.2405,0,0,0,0,0,0);//Groove Street


    AddPlayerClass(102,1905.9363,-1116.6217,25.6641,183.8715,0,0,0,0,0,0);//Ballas
    AddPlayerClass(103,1905.9363,-1116.6217,25.6641,183.8715,0,0,0,0,0,0);//Ballas
    AddPlayerClass(104,1905.9363,-1116.6217,25.6641,183.8715,0,0,0,0,0,0);//Ballas

    AddPlayerClass(114,1782.8358,-1704.0781,13.5169,2.4632,0,0,0,0,0,0);//Atztecas
    AddPlayerClass(115,1782.8358,-1704.0781,13.5169,2.4632,0,0,0,0,0,0);//Atztecas
    AddPlayerClass(116,1782.8358,-1704.0781,13.5169,2.4632,0,0,0,0,0,0);//Atztecas

    AddPlayerClass(108,2141.4924,-1192.1055,23.9922,267.3955,0,0,0,0,0,0);//Vagos
    AddPlayerClass(109,2141.4924,-1192.1055,23.9922,267.3955,0,0,0,0,0,0);//Vagos
    AddPlayerClass(110,2141.4924,-1192.1055,23.9922,267.3955,0,0,0,0,0,0);//Vagos

    AddPlayerClass(280,1545.3284,-1675.7504,13.5601,92.0855,0,0,0,0,0,0);//Regierung
    AddPlayerClass(281,1545.3284,-1675.7504,13.5601,92.0855,0,0,0,0,0,0);//Regierung
    AddPlayerClass(282,1545.3284,-1675.7504,13.5601,92.0855,0,0,0,0,0,0);//Regierung
    AddPlayerClass(283,1545.3284,-1675.7504,13.5601,92.0855,0,0,0,0,0,0);//Regierung
    AddPlayerClass(284,1545.3284,-1675.7504,13.5601,92.0855,0,0,0,0,0,0);//Regierung
    AddPlayerClass(285,1545.3284,-1675.7504,13.5601,92.0855,0,0,0,0,0,0);//Regierung
    AddPlayerClass(286,1545.3284,-1675.7504,13.5601,92.0855,0,0,0,0,0,0);//Regierung
    AddPlayerClass(287,1545.3284,-1675.7504,13.5601,92.0855,0,0,0,0,0,0);//Regierung
    AddPlayerClass(288,1545.3284,-1675.7504,13.5601,92.0855,0,0,0,0,0,0);//Regierung


    AddStaticVehicle(522,2512.0530,-1689.0830,13.1234,46.9179,86,86); // Grove Street NRG-500
    AddStaticVehicle(522,2508.3127,-1685.5830,13.1258,46.9995,86,86); // Grove Street NRG-5002
    AddStaticVehicle(522,2507.5210,-1695.0830,13.1272,0.7991,86,86); // Grove Street NRG-5003
    AddStaticVehicle(429,2504.9653,-1694.5709,13.2364,0.9171,86,1); // Grove Street Banshee
    AddStaticVehicle(487,2527.2729,-1677.6573,20.1073,89.5620,86,1); // Grove Street Maverick
    AddStaticVehicle(409,2516.3467,-1672.0077,13.7338,62.3045,86,1); // Grove Street Limo
    AddStaticVehicle(495,2506.3186,-1650.2441,14.0830,136.7201,86,1); // Grove Street Sand King
    AddStaticVehicle(495,2466.7517,-1688.1211,13.8651,269.2346,86,1); // Grove Street Sand King 2
    AddStaticVehicle(415,2482.2219,-1691.4919,13.2894,353.1578,86,1); // Grove Street Cheetah
    AddStaticVehicle(560,2473.1904,-1692.0784,13.2190,359.8370,86,86); // Grove Street Sultan 1
    AddStaticVehicle(560,2486.3958,-1653.5425,13.1036,87.5378,86,1); // Grove Street Sultan 2
    AddStaticVehicle(560,2468.3921,-1668.6465,13.0913,204.8953,86,1); // Grove Street Sultan 3
    AddStaticVehicle(560,2498.1069,-1683.2324,13.0838,283.5181,86,1); // Grove Street Sultan 4
    AddStaticVehicle(560,2515.0107,-1680.2344,13.1838,48.3692,86,1); // Grove Street Sultan 5
    return 1;
    }


    public SyncUp()
    {
    DollahScoreUpdate();
    }


    public GameModeExitFunc()
    {
    KillTimer(synctimer);
    GameModeExit();
    }


    100% Selfmade Reallife Loading ...



  • Bei /givecash steht das,


    if(strcmp(cmd, "/givecash", true) == 0) // Gives some cash to the player
    {
    if (AccountInfo[playerid][AdminLevel] >= 2 || IsPlayerAdmin(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, ORANGE, "USAGE: /givecash [playername/id] [cash]");
    SendClientMessage(playerid, ORANGE, "FUNCTION: Will give the player some cash. ");
    return 1;
    }


    new giveplayerid = ReturnUser(tmp);
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    tmp = strtok(cmdtext, idx);
    new cash = strval(tmp);
    if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /givecash [playername/id] [cash]");
    format(string, sizeof(string), "-| Administrator %s gave %s $%d |-", sendername,giveplayername,cash);
    SendClientMessageToAdmins(ADMIN_RED, string, 1);
    GivePlayerMoney(giveplayerid, cash);
    }
    else if(giveplayerid == INVALID_PLAYER_ID)
    {
    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
    SendClientMessage(playerid, RED, string);
    }
    }
    else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
    return 1;
    }


    Also er speichert ja das Geld, auch wenn ich neues dazu kriege nur bei Score wird es nicht angezeigt also spätestens dann wenn man neu connectet also:


    Ich connecte mit 5k Score: 5k


    ich hau mir 1k drauf wird nichts aktualisiert,


    ich mache /q connecte erneut,


    erst jetzt steht da das ich 6k habe :/ also es klappt einwandfrei nur es wird nicht aktualisiert


    100% Selfmade Reallife Loading ...



  • statt
    GivePlayerMoney(giveplayerid, cash);
    mach einfach
    GivePlayerMoney(giveplayerid, cash);
    AccountInfo[playerid][Cash]+=cash;sry aber das passiert, wenn man sein script nicht selbstmacht...

  • format(string, sizeof(string), "-| Administrator %s gave %s $%d |-", sendername,giveplayername,cash);
    SendClientMessageToAdmins(ADMIN_RED, string, 1);
    GivePlayerMoney(giveplayerid, cash);
    da runter

  • Ich möchte aber auch das man das hier kriegt:


    Aklso aktualisiert wird


    public OnPlayerDeath(playerid, killerid, reason)
    {
    SendDeathMessage(killerid,playerid,reason);
    GivePlayerMoney(killerid, 2000);
    GivePlayerMoney(playerid, -500);
    return 1;
    }


    100% Selfmade Reallife Loading ...



  • verstehst du das prinzip nicht? oO
    public OnPlayerDeath(playerid, killerid, reason)
    {
    SendDeathMessage(killerid,playerid,reason);
    GivePlayerMoney(killerid, 2000);
    AccountInfo[killerid][Cash]+=2000;
    GivePlayerMoney(playerid, -500);
    AccountInfo[playerid][Cash]-=500;
    return 1;
    }

  • *edit


    So leute, ich habe es fast geschaft ein fehler ist bnur noch drin und zwar, dass anstatt 500$ abgezogen werden, werden 600$ abgezogen wieso ?


    100% Selfmade Reallife Loading ...



    7 Mal editiert, zuletzt von Poseidon ()