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. Május 30. - 23:39:18

Cím: Score HIba
Írta: Norby - 2011. Május 30. - 23:39:18
Eben mi a HIba nem adja hozzá a scoert a játékba amikor beirom javitsátok PLS KÖSZII :D
[pawn]CMD:score(playerid, params[])
{
       if (IsPlayerLAdmin(playerid))
{
        new
        toplayerid,
        amount;
       if (!sscanf(params, \"ii\", toplayerid, amount))
{
       if (toplayerid != INVALID_PLAYER_ID)
   {
           new
           message[40];
           SetPlayerScore(toplayerid, amount);
           format(message, sizeof(message), \"Kaptál %d Pontot az admintól!\", amount);
           SendClientMessage(toplayerid, 0x00FF00FF, message);
   }
       else SendClientMessage(playerid, 0xFF0000FF, \"A játékos Offline\");
}
       else SendClientMessage(playerid, 0xFFFFFFFF, \"Használat: /score <playerid> <pont>\");
}
       else SendClientMessage(playerid, 0xFF0000FF, \"Csak adminok használhatják ezt a parancsot!\");
return 1;
}[/pawn]
Cím: Score HIba
Írta: mauladam - 2011. Május 31. - 19:02:50
Szerintem(én is most kezdtem az sscanf-ot használni.)
Ezt: [pawn]if (!sscanf(params, \"ii\", toplayerid, amount))[/pawn]
Írd át erre: [pawn]if (sscanf(params, \"ii\", toplayerid, amount))[/pawn]
Cím: Score HIba
Írta: ZeRo - 2011. Május 31. - 19:06:24
Így annyira állítod a pontját, amennyit megadsz a parancs beírásánál. Ha hozzá akarod adni a már meglévõkhöz:
[pawn]SetPlayerScore( toplayerid, GetPlayerScore( toplayerid ) + 1 );[/pawn]
Cím: Score HIba
Írta: Norby - 2011. Június 03. - 19:48:22
KÖSSZ KÖSSZ zárok