[Help] rate command 1-10.
#1

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...
Reply
#2

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.
Reply
#3

The thread is closed...
Reply
#4

Help.
Reply
#5

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.
Reply
#6

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

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;
}
Reply
#8

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

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)