Jump to content
  • 0

pomoc Som drevo


maxiKINGdavid

Dotaz

Prosim o pomoc zohnal som si toto

#include <a_samp>
#define SUBOR "Reklamy.txt"
#define TIMER 180
#define SEC(%0) %0*1000
//#define DEBUG
forward SendRandomMessage();
public OnFilterScriptInit()
{
if(!fexist(SUBOR)){
print( "============= Reklama System v1.0 by QWER =============");
printf("Súbor \"%s\" sa nenašiel. Server bol vypnutý !",SUBOR);
SendRconCommand("exit");
}else{
print( "============= Reklama System v1.0 by QWER =============");
print("Súbor sa našiel, všetko OK !");
}
SetTimer("SendRandomMessage",SEC(TIMER),true);
return 1;
}
public SendRandomMessage(){
new File:a = fopen(SUBOR,io_read);
new b,str[128];
while(fread(a,str)){
b++;
}
if(b == 0){
print( "============= Reklama System v1.0 by QWER =============");
printf("Súbor \"%s\" je prázdny (Chýbajú tam reklamy). Server bol vypnutý !",SUBOR);
SendRconCommand("exit");
}
new r = random( +1;
b = 0;
fclose(a);
a = fopen(SUBOR,io_read);
while(fread(a,str)){
if(b == r) {
DelChar(str);
#if defined DEBUG
print(str);
#endif
GameTextForAll(str, 5000, 4);
break;
}
b++;
}
fclose(a);
}
stock DelChar(tstring[])
{
new ln = strlen(tstring);
if(tstring[ln-2] == '\r')tstring[ln-2] = '\0';
if(tstring[ln-1] == '\n')tstring[ln-1] = '\0';
}

viem ze je to script ale neviem co s tym mam robit chcem ta dat ako script na server ale neviem ako pokracovat mam iba toto. Pls o pomoc. Nepiste ze som deb*l ale vazne neviem. :d

Link to comment
Share on other sites

8 odpovědí na tuto otázku

Recommended Posts

  • 0

reklama.amx nahraješ do filterscripts a zapíšeš do configu do řádku filterscripts za poslední skript reklama všechny skripty od sebe oddělené mezerou a reset serveru a =před resetem uděláš ten soubor Reklama.txt do scriptfiles nutnost dodržet velikosti písmen a dopíšeš tam ty reklamy

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...