SA-MP Forums Archive
[Help] rate command 1-10. - 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)
+--- Thread: [Help] rate command 1-10. (/showthread.php?tid=426866)



[Help] rate command 1-10. - Activest - 30.03.2013

I want to make /rate command, 1-10 and the result will be x/10 in file...
I'll be happy if you can help me to do it, ty.

Example:
Player 1 - /rate 6
Player 2 - /rate 3
Should to be x/10...


Re: [Help] rate command 1-10. - RajatPawar - 30.03.2013

If you are requesting code, this is the thread for it: https://sampforum.blast.hk/showthread.php?tid=413556
This is the forum for any help you need.


Re: [Help] rate command 1-10. - Activest - 30.03.2013

The thread is closed...


Re: [Help] rate command 1-10. - Activest - 31.03.2013

Help.


Re: [Help] rate command 1-10. - Neil. - 31.03.2013

Quote:
Originally Posted by Activest
Посмотреть сообщение
Help.
This is the scripting help section. By that, means you already started of something and we can (hopefully) work on it.


Re: [Help] rate command 1-10. - Activest - 31.03.2013

I don't know how to start it, need to calculate, but I have no idea how.


Re: [Help] rate command 1-10. - Neil. - 31.03.2013

I won't do the saving system for you. This can be done via fread and fwrite or dini.
pawn Код:
CMD:rate(playerid, params[])
{
    new rate;
    if(sscanf(params, "i", rate)); return SendClientMessage(playerid, -1, "USAGE: /rate (1-10)");
    {
        if(rate < 1 || rate > 10) return SendClientMessage(playerid, -1, "1-10");
        new pName[MAX_PLAYER_NAME], string[128];
        GetPlayerName(playerid, pName, sizeof(pName));
        format(string,sizeof(string), "%s rated %d/10" , pName, rate);
        SendClientMessageToAll(-1, string);
       
        //Actual Saving
        format(string,sizeof(string), "%d/10", rate);
        //Do your save stuff
    }
    return 1;
}



Re: [Help] rate command 1-10. - XStormiest - 31.03.2013

pawn Код:
stock CalculateMedia(number,number2)
  {
        new result,reduce;
        result = number + number2;
        reduce = result/2;
       return reduce;
  }



Re: [Help] rate command 1-10. - Activest - 31.03.2013

Quote:
Originally Posted by Ken97
Посмотреть сообщение
I won't do the saving system for you. This can be done via fread and fwrite or dini.
pawn Код:
CMD:rate(playerid, params[])
{
    new rate;
    if(sscanf(params, "i", rate)); return SendClientMessage(playerid, -1, "USAGE: /rate (1-10)");
    {
        if(rate < 1 || rate > 10) return SendClientMessage(playerid, -1, "1-10");
        new pName[MAX_PLAYER_NAME], string[128];
        GetPlayerName(playerid, pName, sizeof(pName));
        format(string,sizeof(string), "%s rated %d/10" , pName, rate);
        SendClientMessageToAll(-1, string);
       
        //Actual Saving
        format(string,sizeof(string), "%d/10", rate);
        //Do your save stuff
    }
    return 1;
}
You didn't help me.

Quote:
Originally Posted by XStormiest
Посмотреть сообщение
pawn Код:
stock CalculateMedia(number,number2)
  {
        new result,reduce;
        result = number + number2;
        reduce = result/2;
       return reduce;
  }
Thank you.