SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Thread Tools Display Modes
Old 16/05/2012, 12:27 PM   #1
Dripac's Avatar
Join Date: Apr 2009
Location: Vienna, Austria
Posts: 1,532
Reputation: 256
Thumbs up CreateBox

Hello everyone,

so i am releasing the include which i used for my server.

What is the include about?
- You can use this instead of GameTextForPlayer, so that means there will be a textdraw shown for some seconds (you can define it).

pawn Code:
#include <a_samp>
#include <foreach>

new Text:ueberschrift[MAX_PLAYERS];
new Text:insidetext[MAX_PLAYERS];

static bool:fnc[1] = false;

public OnGameModeInit()
    fnc[0] = (funcidx("CB_OnPlayerConnect") != -1);
    CallLocalFunction("CB_OnGameModeInit", "");

#if defined _ALS_OnGameModeInit
    #undef OnGameModeInit
    #define _ALS_OnGameModeInit
#define OnGameModeInit CB_OnGameModeInit
forward CB_OnGameModeInit();

public OnPlayerConnect(playerid)
    if(fnc[0]) CallLocalFunction("CB_OnPlayerConnect", "i", playerid);
    ueberschrift[playerid] = TextDrawCreate(501.000000, 222.000000, "info");
    TextDrawBackgroundColor(ueberschrift[playerid], 50);
    TextDrawFont(ueberschrift[playerid], 2);
    TextDrawLetterSize(ueberschrift[playerid], 0.320000, 1.299999);
    TextDrawColor(ueberschrift[playerid], -1);
    TextDrawSetOutline(ueberschrift[playerid], 1);
    TextDrawSetProportional(ueberschrift[playerid], 1);
    TextDrawUseBox(ueberschrift[playerid], 1);
    TextDrawBoxColor(ueberschrift[playerid], 6062591);
    TextDrawTextSize(ueberschrift[playerid], 586.000000, 0.000000);
    insidetext[playerid] = TextDrawCreate(501.000000, 237.000000, "text");
    TextDrawBackgroundColor(insidetext[playerid], 50);
    TextDrawFont(insidetext[playerid], 0);
    TextDrawLetterSize(insidetext[playerid], 0.270000, 1.000000);
    TextDrawColor(insidetext[playerid], -1);
    TextDrawSetOutline(insidetext[playerid], 1);
    TextDrawSetProportional(insidetext[playerid], 1);
    TextDrawUseBox(insidetext[playerid], 1);
    TextDrawBoxColor(insidetext[playerid], 150);
    TextDrawTextSize(insidetext[playerid], 586.000000, 0.000000);
    return 1;

#if defined _ALS_OnPlayerConnect
    #undef OnPlayerConnect
    #define _ALS_OnPlayerConnect
#define OnPlayerConnect CB_OnPlayerConnect
forward CB_OnPlayerConnect(playerid);

stock CreateBox(playerid,header[],text[])
    new string[128];

    format(string, sizeof string,"%s",header);

    format(string, sizeof string,"%s",text);

    PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);

    SetTimerEx("CloseBox", 5000, 0, "i", playerid);
    return 1;

forward CloseBox(playerid);
public CloseBox(playerid)
    return 1;

Copy the code and paste it in notepad, now save it as and put it in your includes folder which is located at the pawno application.

Alright, now you want to use it, right?

Here a command for testing:
pawn Code:
if(!strcmp(cmdtext, "/test", true))
        CreateBox(playerid, "info", "Ich liebe alles auf dieser ~r~Welt ~n~~w~und meine ~g~Mutter ~w~am ~y~meisten");
        return 1;


The box will dissapear in 5 seconds, to change it open the include and look for SetTimerEx, change 5000 to how much seconds you want. (5000 = 5 seconds)


Last edited by Dripac; 16/05/2012 at 01:39 PM.
Dripac is offline   Reply With Quote
Old 16/05/2012, 12:31 PM   #2
Big Clucker
Join Date: May 2012
Location: Zeeland,The Netherlands
Posts: 104
Reputation: 15
Default Re: CreateBox

Looks nice makes it much easy'r to script
Jason_Dealley is offline   Reply With Quote
Old 16/05/2012, 12:55 PM   #3
Big Clucker
Saad_'s Avatar
Join Date: Feb 2012
Posts: 66
Reputation: 11
Default Re: CreateBox

Thanks for this looks good :P
Saad_ is offline   Reply With Quote
Old 16/05/2012, 01:08 PM   #4
Big Clucker
HaZaRaS™'s Avatar
Join Date: May 2012
Location: Uk - London
Posts: 142
Reputation: 6
Default Re: CreateBox

that's it ...Ready nice and wonderfull and looks prett NYc ... keep up and +1

I wont read the long and longest answer like 1-7 line .

MY EXPERIANCE = Table making,Forum making,Coding fixing,Port forwording,Fixing 19 run time error.Making an public server, and alot of more ..."PM ME" if you have any kind of question. Feel free to ask.
HaZaRaS™ is offline   Reply With Quote
Old 16/05/2012, 05:40 PM   #5
Niko_boy's Avatar
Join Date: Aug 2010
Location: Somewhere i belong
Posts: 1,336
Reputation: 138
Default Re: CreateBox

well could be useful for making some attractive GameText's
Nice job
•••[CLOSED]LCS•Freeroam•DM•Stunts•••AutoArena [0.3z][No SkinShot][]Want a decent Attack Defend Gamemode?
N/A176.31.229.148:7830Get This! Attack-Defend(v2.3.1)
Niko_boy is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT. The time now is 09:54 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.