#include <a_samp>#define TIME 3#define MINIMUM_VALUE 2000000#define MAXIMUM_VALUE 8000000#define MINIMUM_PRIZE 5000#define MAXIMUM_PRIZE 20000#define MINIMUM_SCORE 1#define MAXIMUM_SCORE 7new CONTEST_PRIZE;new CONTEST_SCORE;new ContestAnswer = -1;forward NewContest();forward OnPlayerWinContest(playerid);public OnFilterScriptInit(){SetTimer(\"NewContest\",(1000*60*TIME),1);return 1;}public OnPlayerText(playerid, text[]){if(strval(text) == ContestAnswer && ContestAnswer != -1){OnPlayerWinContest(playerid);}return 1;}public NewContest(){new string [128];ContestAnswer = MINIMUM_VALUE + random(MAXIMUM_VALUE-MINIMUM_VALUE);format(string,sizeof string,\"Reakció teszt ! Aki elõször beírja: %d az nyer %d $-t és %d pontot !\",ContestAnswer,CONTEST_PRIZE,CONTEST_SCORE);SendClientMessageToAll(0x00FFFFFF,string);return 1;}public OnPlayerWinContest(playerid){new pName[MAX_PLAYER_NAME],string[128];GetPlayerName(playerid,pName,sizeof pName);format(string,sizeof string,\"%s nyerte meg a reakció tesztet jutalma: %d $ és %d pont !\",pName,CONTEST_PRIZE,CONTEST_SCORE);SendClientMessageToAll(0x00FFFFFF,string);CONTEST_PRIZE = MINIMUM_PRIZE+random(MAXIMUM_PRIZE-MINIMUM_PRIZE);GivePlayerMoney(playerid,CONTEST_PRIZE);CONTEST_SCORE = MINIMUM_SCORE+random(MAXIMUM_SCORE-MINIMUM_SCORE);SetPlayerScore(playerid, GetPlayerScore(playerid) + CONTEST_SCORE);ContestAnswer = -1;return 1;}
#include <a_samp>#define TIME 3#define MINIMUM_VALUE 2000000#define MAXIMUM_VALUE 8000000#define MINIMUM_PRIZE 5000#define MAXIMUM_PRIZE 20000#define MINIMUM_SCORE 1#define MAXIMUM_SCORE 7new CONTEST_PRIZE;new CONTEST_SCORE;new ContestAnswer = -1;forward NewContest();forward OnPlayerWinContest(playerid);public OnFilterScriptInit(){SetTimer(\"NewContest\",(1000*60*TIME),1);return 1;}public OnPlayerText(playerid, text[]){if(strval(text) == ContestAnswer && ContestAnswer != -1){OnPlayerWinContest(playerid);}return 1;}public NewContest(){new string [128];ContestAnswer = MINIMUM_VALUE + random(MAXIMUM_VALUE-MINIMUM_VALUE);format(string,sizeof string,\"Reakció teszt ! Aki elõször beírja: %d az nyer %d $-t és %d pontot !\",ContestAnswer,CONTEST_PRIZE,CONTEST_SCORE);SendClientMessageToAll(0x00FFFFFF,string);return 1;}public OnPlayerWinContest(playerid){new pName[MAX_PLAYER_NAME],string[128];GetPlayerName(playerid,pName,sizeof pName);format(string,sizeof string,\"%s nyerte meg a reakció tesztet jutalma: %d $ és %d pont !\",pName,CONTEST_PRIZE,CONTEST_SCORE);SendClientMessageToAll(0x00FFFFFF,string);CONTEST_PRIZE = MINIMUM_PRIZE+random(MAXIMUM_PRIZE-MINIMUM_PRIZE);GivePlayerMoney(playerid, 50000);CONTEST_SCORE = MINIMUM_SCORE+random(MAXIMUM_SCORE-MINIMUM_SCORE);SetPlayerScore(playerid, 10);ContestAnswer = -1;return 1;}
Thx és nem tudom hogy ez olyan hogyha bizonyos idõn belül senki nem írja be a számokat akkor ad egy új feladatot ?
Hát igen, timerrel kéne de én sem tudom hogy hogyan
public NewContest(){new string [128];ContestAnswer = MINIMUM_VALUE + random(MAXIMUM_VALUE-MINIMUM_VALUE);format(string,sizeof string,\"Reakció teszt ! Aki elõször beírja: %d az nyer %d $-t és %d pontot !\",ContestAnswer,CONTEST_PRIZE,CONTEST_SCORE);SendClientMessageToAll(0x00FFFFFF,string);reaction = SetTimer(\"reaction2\",120000,1); // 2 percreturn 1;}