[FilterScript] Question Calculator Game
#1

Now all players can write answer on Calculator questions and win for this some money or another thing!

If you like it, give me rep+! thx

Download!

PHP код:

#define FILTERSCRIPT
#include <a_samp>
#define questiontime 2//2 its time in minutes when players see another question, you can change it!
forward AnswerSysTimer();
new 
PravelniyOtvet 0;
public 
OnFilterScriptInit()
{
    new 
time questiontime*60000;
    print(
"Question Sys By brawrr / Skype Rev1se");
    
SetTimer("AnswerSysTimer"time1);
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    new 
string[80],cmd[256],tmp[256], idx;
    
cmd strtok(cmdtextidx);
    if(
strcmp(cmd"/ans"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
PravelniyOtvet == 0)
            {
                
SendClientMessage(playerid0xFF6347AA"There are no questions!");
                return 
1;
            }
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playerid0xFF6347AA"Help: /ans [answer]");
                return 
1;
            }
            new 
otvet;
            
otvet strval(tmp);
            if(
otvet < -9999 || otvet 9999)
            {
                
SendClientMessage(playerid0xFF6347AA"Answer can by  -9999 - 9999!");
                return 
1;
            }
            new 
playername[MAX_PLAYER_NAME];
            
GetPlayerName(playeridplayername,MAX_PLAYER_NAME);
            if(
otvet == PravelniyOtvet)
            {
                
//GivePlayerMoney(playerid, 10000); Uncomment if you wont give to player some money for right answer
                
format(stringsizeof(string), "[Question] %s answered: %d, That's right!",playername,otvet);
                
SendClientMessageToAll(0x1CBC46AAstring);
                
PravelniyOtvet 0;
            }
            else
            {
                
format(stringsizeof(string), "[Question] %s answered: %d, Wrong answer!",playername,otvet);
                
SendClientMessageToAll(0xFF6347AAstring);
            }
        }
        return 
1;
    }
    return 
1;
}
public 
AnswerSysTimer()
{
    new 
string[60];
    new 
rand1 random(999)+1;
    new 
rand2 random(999)+1;
    new 
rand3 random(999)+1;
    
PravelniyOtvet rand1+rand2-rand3;
    
format(stringsizeof(string), "[Question] %d+%d-%d? Write answer /ans",rand1,rand2,rand3);
    
SendClientMessageToAll(0xFF6347AAstring);
    return 
1;
}
strtok(const string[], &index)
{
    new 
length strlen(string);
    while ((
index length) && (string[index] <= ' '))
    {
        
index++;
    }
    new 
offset index;
    new 
result[20];
    while ((
index length) && (string[index] > ' ') && ((index offset) < (sizeof(result) - 1)))
    {
        
result[index offset] = string[index];
        
index++;
    }
    
result[index offset] = EOS;
    return 
result;

Reply
#2

seems nice +REP keep it up
Reply
#3

Nice!
Reply
#4

nice need some shots
Reply
#5

Very good work dude , I like your idea
I love it
+REP
Reply
#6

Xport6050 what shots? i can update script, if need some thing...
Reply
#7

Nice
Reply
#8

thx, any sugestions for update this script?
Reply
#9

Awesome! , +1 rep
Reply
#10

download link is updated!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)