SA-MP Forums Archive
command givescore - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: command givescore (/showthread.php?tid=106357)



command givescore - RenisiL - 02.11.2009

Hey please help me please give me commands /givescore

- RenisiL


Re: command givescore - _Vortex - 02.11.2009

http://forum.sa-mp.com/index.php?topic=114903.0


Re: command givescore - Correlli - 02.11.2009

Quote:
Originally Posted by RenisiL
Hey please help me please give me commands /givescore
More information about this command? Like what should it do? Display your score or?


Re: command givescore - Kyosaur - 02.11.2009

pawn Код:
//needs dcmd and sccanf - search or pm me if you dont have it.

//top - global var
new String[128];

//OnPlayerCommandText

dcmd(givescore, 9, cmdtext);

//Anywhere else (not in a callback ofc)
dcmd_givescore(playerid, params[])
{
    new GivePlayerID, Score;
    if(!sscanf(params, "ud", GivePlayerID, Score))
    {
      if(IsPlayerConnected(GivePlayerID))
      {
        new Name[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME],current = GetPlayerScore(GivePlayerID);
        SetPlayerScore(GivePlayerID, current+Score);
        GetPlayerName(GivePlayerID, Name, sizeof(Name));
        GetPlayerName(playerid, pName, sizeof(pName));
       
        format(String, sizeof(String), "You were given %d score points by %s!",Score,pName);
        SendClientMessage(playerid, 0xFFFFFFFF, String);
        format(String, sizeof(String), "You gave %s %d score points!",Name,Score);
        SendClientMessage(playerid, 0xFFFFFFFF, String);
        return 1;
      }
      SendClientMessage(playerid,0xAA3333AA, "Error: That player isnt connected!");
      return 1;
    }
    SendClientMessage(playerid,0xAA3333AA, "Syntax Error: /Givescore <UserName/ID> <Score>");
    return 1;
}



Re: command givescore - Superrollo - 02.08.2011

Quote:
Originally Posted by Kyosaur
Посмотреть сообщение
pawn Код:
//needs dcmd and sccanf - search or pm me if you dont have it.

//top - global var
new String[128];

//OnPlayerCommandText

dcmd(givescore, 9, cmdtext);

//Anywhere else (not in a callback ofc)
dcmd_givescore(playerid, params[])
{
    new GivePlayerID, Score;
    if(!sscanf(params, "ud", GivePlayerID, Score))
    {
      if(IsPlayerConnected(GivePlayerID))
      {
        new Name[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME],current = GetPlayerScore(GivePlayerID);
        SetPlayerScore(GivePlayerID, current+Score);
        GetPlayerName(GivePlayerID, Name, sizeof(Name));
        GetPlayerName(playerid, pName, sizeof(pName));
       
        format(String, sizeof(String), "You were given %d score points by %s!",Score,pName);
        SendClientMessage(playerid, 0xFFFFFFFF, String);
        format(String, sizeof(String), "You gave %s %d score points!",Name,Score);
        SendClientMessage(playerid, 0xFFFFFFFF, String);
        return 1;
      }
      SendClientMessage(playerid,0xAA3333AA, "Error: That player isnt connected!");
      return 1;
    }
    SendClientMessage(playerid,0xAA3333AA, "Syntax Error: /Givescore <UserName/ID> <Score>");
    return 1;
}
I tried that, but for some reason it gives 0 score no matter what amount I insert.