Kod: Tümünü seç
/**
* Created by AMXX-Stuido
* User: ITenGriTR
* Date: 12.09.2019
* Time 18.30
*/
#include <amxmodx>
#include <cstrike>
#define iD_CountWord 22
#define iD_HowMuch 8
#define sD_ChatTag "!n[ !t !n]"
new iG_Time,iG_QuestStatus,sG_Required[iD_HowMuch+1];
new const sG_Words[][] = {
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i",
"j",
"k",
"l",
"m",
"n",
"o",
"u",
"p",
"r",
"s",
"t",
"v",
"y",
"z"
}
public plugin_init(){
register_plugin
("TSUSTUM",
"1.0",
"Berk");
register_clcmd("say","pGoAnswer");
iG_Time = register_cvar("tsustum_zaman","10");
set_task(get_pcvar_float(iG_Time),"pAskQuestion",0);
}
public pAskQuestion(){
new iL_Num = 0,iL_Random;
iG_QuestStatus = 1;
sG_Required = "";
for(new i; i < iD_HowMuch; i++){
iL_Random = random_num(0,iD_CountWord);
iL_Num += formatex(sG_Required[iL_Num],iD_HowMuch-iL_Num,"%s",sG_Words[iL_Random]);
}
sColoredChat(0,"%s !gIlk yazan kazanir !n[ !t%s !n]!n!",sD_ChatTag,sG_Required);
remove_task();
set_task(get_pcvar_float(iG_Time)+15.0,"pNewQuestion");
}
public pNewQuestion(){
if(iG_QuestStatus == 1){
sColoredChat(0,"%s !gSoruyu bilen yok yeni soru birazdan geliyor!n!",sD_ChatTag);
remove_task();
set_task(get_pcvar_float(iG_Time),"pAskQuestion",0);
}
}
public pGoAnswer(iP_ID){
if(iG_QuestStatus == 1){
new sL_Arg[iD_HowMuch+2];
read_args(sL_Arg,iD_HowMuch+1);
remove_quotes(sL_Arg);
if(equali(sG_Required,sL_Arg[1])){
iG_QuestStatus = 0;
cs_set_user_money(iP_ID,cs_get_user_money(iP_ID)+2000);
sColoredChat(iP_ID,"%s !gDogru yazdin !n[ !t2000$ !n] !gkazandin!n!",sD_ChatTag);
remove_task();
set_task(get_pcvar_float(iG_Time)+20.0,"pAskQuestion",0);
}
}
}
#if AMXX_VERSION_NUM < 183
stock sColoredChat(const id, const input[], any:...){
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);
replace_all(msg, 190, "!n", "^x01"); // Default Renk(Sary)
replace_all(msg, 190, "!g", "^x04"); // Ye?il Renk
replace_all(msg, 190, "!t", "^x03"); // Takym Renk( CT mavi , T kyrmyzy )
if (id) players[0] = id; else get_players(players, count, "ch");{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
#else
stock sColoredChat(const id, const input[], any:...){
static msg[191];
vformat(msg, 190, input, 3);
replace_all(msg, 190, "!n", "^x01");
replace_all(msg, 190, "!g", "^x04");
replace_all(msg, 190, "!t", "^x03");
client_print_color(id, id, msg);
}
#endif
Kod: Tümünü seç
native crxranks_set_user_xp(index, amount);
native crxranks_get_user_xp(amount);