Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include < zcmd >
- #include < DOF2 >
- #define MSG 54
- new Text:Principal;
- new gi@cou;
- public OnFilterScriptInit()
- {
- print("* System News 2.0 por @LucasVinicius carregado com sucesso!");
- Principal = TextDrawCreate(6.000000, 425.000000, "Loading...");
- TextDrawBackgroundColor(Principal, 255);
- TextDrawFont(Principal, 1);
- TextDrawLetterSize(Principal, 0.200000, 1.500000);
- TextDrawColor(Principal, -1);
- TextDrawSetOutline(Principal, 1);
- TextDrawSetProportional(Principal, 1);
- RandomNoticias();
- SetTimer("RandomNoticias", 3*60000, true);
- return 1;
- }
- public OnFilterScriptExit()
- {
- DOF2_Exit();
- return 1;
- }
- forward RandomNoticias();
- public RandomNoticias()
- {
- new s@Msg[128];
- new ls@an[32], ls@fan[64], lb@isc;
- if(lb@isc == 0) lb@isc += 1;
- if(lb@isc == 3) return 1;
- format(ls@an, sizeof(ls@an), "Anuncio%d", gi@cou);
- DOF2_GetString("Anuncio.ini", ls@an, ls@fan);
- if(!strcmp("", ls@fan, true, 10))
- {
- gi@cou = 0;
- return RandomNoticias();
- }
- format(s@Msg, 128, "~w~ %s", ls@fan);
- TextDrawSetString(Principal, s@Mensg);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- TextDrawShowForPlayer(playerid,Principal);
- return 1;
- }
- CMD:mensagens(playerid) {
- new ls@buf[1200];
- for(new i; i < 20; i++)
- {
- new ls@an[32];
- new ls@fan[64];
- format(ls@an, 32, "Anuncio: %d", i);
- DOF2_GetString("Anuncio.ini", ls@an, ls@fan);
- if(!strcmp("", ls@fan, true, 10)) break;
- format(ls@buf, 1200, "%s\n > %d - %s", ls@buf, i, ls@fan);
- }
- ShowPlayerDialog(playerid, MSG, DIALOG_STYLE_MSGBOX, "MensagemTD In-Game", ls@buf, "Fechar", "");
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
- if(dialogid == MSG) {
- if(!response)
- {
- new buff;
- for(new i; i < 20; i++)
- {
- new ls@an[32];
- new ls@fan[64];
- format(ls@an, 32, "Anuncio: %d", i);
- DOF2_GetString("Anuncio.ini", ls@an, ls@fan);
- if(!strcmp("", ls@fan, true, 10))
- {
- buff = i;
- break;
- }
- }
- new ls@an[32];
- format(ls@an, 32, "Anuncio: %d", buff);
- DOF2_SetString("Anuncio.ini", ls@an, inputtext);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment