Jump to content

[PAWN] Tutorial 2 - Chat


PresidenT AnaS
 Share

Recommended Posts

Hello this day we have Tutorial about [P]awno #Chat.

Etapes:

 

//Includes

 

 
#include <a_samp>
#include <ocmd>
#include <sscanf2>
#include <a_mysql>
 
 
//Farben
#define COLOR_RED 0xFF0000FF
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_BLUE 0x009BFFFF
#define COLOR_YELLOW 0xEBFF00FF
#define COLOR_CHAT 0xFEFEFEFF
#define COLOR_FADE1 0xE6E6E6FF
#define COLOR_FADE2 0xD1CFD1FF
#define COLOR_FADE3 0xBEC1BEFF
#define COLOR_FADE4 0x919397FF
//Dialoge
#define DIALOG_TELEPORT 1
#define DIALOG_REGISTER 2
#define DIALOG_LOGIN 3
#define DIALOG_AUTOHAUS 4
//MySQL
#define db_host "127.0.0.1"
#define db_user "samp"
#define db_pass "mysqlpasswort"
#define db_db "samp"
//Limits
#define CHAT_RADIUS 40
#define CHAT_FADES 5
//Globale Variablen
new dbhandle;
new sInfo[MAX_PLAYERS][playerInfo];
new fInfo[][fraktEnum] = {
{"Zivilist", 0.0, 0.0, 0.0, 0.0, 0, 0, COLOR_WHITE},
{"LSPD", 295.2865,-55.4151,2.7772,293.463, 0, 0, COLOR_BLUE},
{"Taxi", 0.0, 0.0, 0.0, 0.0, 0, 0, COLOR_YELLOW}
};
new bInfo[][buildingsEnum] = {
{243.0825,-178.3224,1.5822,285.3642,-41.5576,1001.5156,1,"AMMUN1"},//Ammunation1
{212.1142,-202.1886,1.5781,372.4523,-133.5244,1001.4922,5,"FDPIZA"}//Pizza
};
new cInfo[50][carEnum];
new ahInfo[][autohausEnum] = {
{125.7242,-170.1469,1.2838,177.7335},//id: 0 1. autohaus
{189.8910,-263.3446,1.2829,180.6895}//id: 1 2. autohaus
};
new ahCars[][autohauscarEnum] = {
{560,118.5637,-153.0834,1.2834,186.6475,50000,0},
{411,106.3420,-158.7720,1.7527,257.3197,80000,0},
{400,204.8894,-265.4756,1.2866,354.1406,10000,1}
};
new sekunden_timer;
new autosOhneMotor[] = {509,510,481};
new Text:uhrzeitLabel;
 
//Timer
sekunden_timer = SetTimer("sekunde",1000,true);
//Textdraws
uhrzeitLabel = TextDrawCreate(557.000000, 12.000000, "00:00");
TextDrawBackgroundColor(uhrzeitLabel, 255);
TextDrawFont(uhrzeitLabel, 3);
TextDrawLetterSize(uhrzeitLabel, 0.580000, 2.399999);
TextDrawColor(uhrzeitLabel, -1);
TextDrawSetOutline(uhrzeitLabel, 1);

 

TextDrawSetProportional(uhrzeitLabel, 1);
 
-- //Passwort richtig //Spieler laden
sInfo[playerid][eingeloggt] = 1;
sInfo[playerid][level] = cache_get_field_content_int(0,"level",dbhandle);
SetPlayerScore(playerid,sInfo[playerid][level]);
sInfo[playerid][db_id] = cache_get_field_content_int(0,"id",dbhandle);
SetPlayerMoney(playerid,cache_get_field_content_int(0,"money",dbhandle));
sInfo[playerid][alevel] = cache_get_field_content_int(0,"alevel",dbhandle);
sInfo[playerid][fraktion] = cache_get_field_content_int(0,"fraktion",dbhandle);
sInfo[playerid][rang] = cache_get_field_content_int(0,"rang",dbhandle);
sInfo[playerid][spawnchange] = cache_get_field_content_int(0,"spawnchange",dbhandle);
 
//Spawn
 
SetPlayerPos(playerid,199.0846,-150.0331,1.5781);
 

 

}
if(listitem==1)
{
//Farm
SetPlayerPos(playerid,0.0,0.0,6.0);
}
}
else
{
SendClientMessage(playerid,COLOR_RED,"Vorgang abgebrochen.");
}
return 1;
}
return 1;
}
 
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}

 

 

Thanks for your time.Good-Bye.

Edited by Cdorsu
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.