Szerző Téma: Score  (Megtekintve 447 alkalommal)

Nem elérhető Norby

  • 1575
    • Profil megtekintése
Score
« Dátum: 2011. Június 03. - 20:02:15 »
0 Show voters
[pawn]SetPlayerScore( toplayerid, GetPlayerScore( toplayerid ) + 1 );[/pawn]
ezt hogy lehet átirni hogy hozzá adjon a meglévõhöz mert igy csak + 1 et ad hozzá de annyit kellene amennyit beirok
Köszii

Nem elérhető ZeRo

  • 4620
  • Ex Globális Moderátor
    • Profil megtekintése
Score
« Válasz #1 Dátum: 2011. Június 03. - 21:13:22 »
0 Show voters
Hogy érted, hogy \"amennyit beírok\"? Pl: /score <ID> <pont> ? Akkor:
[pawn]
CMD:score( playerid, params[  ] ) {
    new iPl, iScore;
    if( sscanf( params, \"ud\", iPl, iScore ) ) {
        SendClientMessage( playerid, 0xFF0000AA, \"Használat: /score <ID> <pont>\" );
    } else if( !IsPlayerConnected( iPl ) || IsPlayerNPC( iPl ) ) {
        SendClientMessage( playerid, 0xFF0000AA, \"Érvénytelen azonosító!\" );
    } else {
        new szMsg[ 80 ], szName[ MAX_PLAYER_NAME ];
        SetPlayerScore( iPl, GetPlayerScore( iPl ) + iScore );
        GetPlayerName( playerid, szName, MAX_PLAYER_NAME );
        format( szMsg, sizeof szMsg, \"%s adott neked %d pontot.\", szName, iScore );
        SendClientMessage( iPl, 0x00FF00AA, szMsg );
    }
    return 1;
}
[/pawn]

Nem elérhető Norby

  • 1575
    • Profil megtekintése
Score
« Válasz #2 Dátum: 2011. Június 03. - 22:21:54 »
0 Show voters
Köszi KÖszi pont ez kellet :D

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal