GTA Közösség - A magyar GTA fórum

San Andreas Multiplayer (SA-MP) => SA-MP: Szerverfejlesztés => Segítségkérés => A témát indította: Norby - 2011. Június 03. - 20:02:15

Cím: Score
Írta: Norby - 2011. Június 03. - 20:02:15
[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
Cím: Score
Írta: ZeRo - 2011. Június 03. - 21:13:22
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]
Cím: Score
Írta: Norby - 2011. Június 03. - 22:21:54
Köszi KÖszi pont ez kellet :D