Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include <a_samp>
- #include <a_http>
- new Text:WhatsNewText[MAX_PLAYERS];
- forward HideTextDraw2(playerid);
- public HideTextDraw2(playerid) {
- TextDrawHideForPlayer(playerid, WhatsNewText[playerid]);
- return 1;
- }
- forward UpdateResponse(playerid, response_code, data[]);
- public UpdateResponse(playerid, response_code, data[])
- {
- new
- string[ 1028 ];
- if(response_code == 200)
- {
- format(string, sizeof(string), "%s", data);
- TextDrawSetString(WhatsNewText[playerid], string);
- TextDrawShowForPlayer(playerid, WhatsNewText[playerid]);
- SetTimerEx("HideTextDraw2", 15000, false, "i", playerid);
- }
- else
- {
- format(string, sizeof(string), "The request failed! The response code was: %d", response_code);
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- }
- }
- public OnPlayerConnect(playerid) {
- WhatsNewText[playerid] = TextDrawCreate(36, 198, " ");
- TextDrawFont(WhatsNewText[playerid], 1);
- TextDrawLetterSize(WhatsNewText[playerid], 0.2, 1.4);
- TextDrawColor(WhatsNewText[playerid], 0xFFFFFFFF);
- TextDrawSetOutline(WhatsNewText[playerid], 0);
- TextDrawSetProportional(WhatsNewText[playerid], 1);
- TextDrawSetShadow(WhatsNewText[playerid], 0);
- TextDrawHideForPlayer(playerid, WhatsNewText[playerid]);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason) {
- TextDrawDestroy(WhatsNewText[playerid]);
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[]) {
- if(strcmp(cmdtext, "/new", true) == 0)
- {
- HTTP(playerid, HTTP_GET, "devine-gaming.com/update_test.txt", "", "UpdateResponse");
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement