Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: Deko poslato Januar 06, 2015, 20:45:04 POSLE PODNE

Naslov: [Pomoc]Desni gornji "ćošak"
Poruka od: Deko poslato Januar 06, 2015, 20:45:04 POSLE PODNE
Skripta koju koristim: //
Detaljan opis problema: Kako da u desnom gornjem 'ćosku' napravim da pise ono ime servera i to...
Dio skripte://
Slike://
Naslov: Odg: [Pomoc]Desni gornji "ćošak"
Poruka od: youngdeal poslato Januar 06, 2015, 20:46:12 POSLE PODNE
Skines textdraw editor i uradis td.
Naslov: Odg: [Pomoc]Desni gornji "ćošak"
Poruka od: Deko poslato Januar 06, 2015, 21:17:44 POSLE PODNE
Moze link trazio sam al nema...
Naslov: Odg: [Pomoc]Desni gornji "ćošak"
Poruka od: ▂ ▃ ▅ Rudimental ▅ ▃ ▂ poslato Januar 06, 2015, 21:53:26 POSLE PODNE
http://forum.sa-mp.com/showthread.php?t=376758
Naslov: Odg: [Pomoc]Desni gornji "ćošak"
Poruka od: Deko poslato Januar 06, 2015, 22:07:04 POSLE PODNE
Nasao sam neku FS i sad editam je :D i zasto nece randommessages ?


#include <a_samp>
//---------------------------------------------------------------------------- > News, enums
new Text:Textdraw3;
new Text:Textdraw5;
new Text:Textdraw6;
new Text:Textdraw7;
new Text:Textdraw8;
new Text:Textdraw9;
//---------------------------------------------------------------------------- > Forwards
forward RandomMessage();
//---------------------------------------------------------------------------- > OnFilterScriptInit
public OnFilterScriptInit()
{



Textdraw3 = TextDrawCreate(25.000000, 435.000000, "Y:RP");
TextDrawBackgroundColor(Textdraw3, 255);
TextDrawFont(Textdraw3, 2);
TextDrawLetterSize(Textdraw3, 0.349999, 1.300000);
TextDrawColor(Textdraw3, -16776961);
TextDrawSetOutline(Textdraw3, 0);
TextDrawSetProportional(Textdraw3, 1);
TextDrawSetShadow(Textdraw3, 1);
TextDrawSetSelectable(Textdraw3, 0);


Textdraw5 = TextDrawCreate(73.000000, 434.000000, "Dobrodosli na Yugoslavia RolePlay!");
TextDrawBackgroundColor(Textdraw5, 255);
TextDrawFont(Textdraw5, 2);
TextDrawLetterSize(Textdraw5, 0.289999, 1.500000);
TextDrawColor(Textdraw5, -1);
TextDrawSetOutline(Textdraw5, 0);
TextDrawSetProportional(Textdraw5, 1);
TextDrawSetShadow(Textdraw5, 1);
TextDrawSetSelectable(Textdraw5, 0);

Textdraw6 = TextDrawCreate(540.000000, 0.000000, "Y");
TextDrawBackgroundColor(Textdraw6, 255);
TextDrawFont(Textdraw6, 1);
TextDrawLetterSize(Textdraw6, 0.800000, 3.000000);
TextDrawColor(Textdraw6, -16776961);
TextDrawSetOutline(Textdraw6, 0);
TextDrawSetProportional(Textdraw6, 1);
TextDrawSetShadow(Textdraw6, 1);
TextDrawSetSelectable(Textdraw6, 0);

Textdraw7 = TextDrawCreate(554.000000, 0.000000, "ugoslavia");
TextDrawBackgroundColor(Textdraw7, 255);
TextDrawFont(Textdraw7, 0);
TextDrawLetterSize(Textdraw7, 0.810000, 3.000000);
TextDrawColor(Textdraw7, -1);
TextDrawSetOutline(Textdraw7, 1);
TextDrawSetProportional(Textdraw7, 1);
TextDrawSetSelectable(Textdraw7, 0);

Textdraw8 = TextDrawCreate(580.000000, 26.000000, "~r~R~w~P");
TextDrawBackgroundColor(Textdraw8, 255);
TextDrawFont(Textdraw8, 2);
TextDrawLetterSize(Textdraw8, 0.579999, 1.500000);
TextDrawColor(Textdraw8, -16776961);
TextDrawSetOutline(Textdraw8, 0);
TextDrawSetProportional(Textdraw8, 1);
TextDrawSetShadow(Textdraw8, 1);
TextDrawSetSelectable(Textdraw8, 0);

Textdraw9 = TextDrawCreate(639.000000, 34.000000, "-");
TextDrawBackgroundColor(Textdraw9, 255);
TextDrawFont(Textdraw9, 1);
TextDrawLetterSize(Textdraw9, -7.369995, 1.000000);
TextDrawColor(Textdraw9, -1);
TextDrawSetOutline(Textdraw9, 0);
TextDrawSetProportional(Textdraw9, 1);
TextDrawSetShadow(Textdraw9, 1);
TextDrawSetSelectable(Textdraw9, 0);


return 1;
}


//---------------------------------------------------------------------------- > RandomMessages recenice
new RandomMessages[][] =
{
"~w~Posetite nas forum ~r~www.~w~jugoslavia.~r~webs.~w~com i registrujte se.",
    "~w~Ukoliko vidite citera prijavite ga na ~r~/report.",
    "~w~Ako ste novi igrac i ako vam treba pomoc ~r~/ovi ili /pitaj.",
    "~w~Za ulazak u organizaciju potreban vam je ~R~Level 2.",
    "~w~Da vidite listu online admina ~r~ /admini!",
    "~w~Da vidite listu online lidera ~r~ /lideri!",
    "~w~Koristite ~r~/gps ~w~da vidite vazne lokacije ~r~ Beograda.",
    "~w~Ako primetite BUG, prijavite ga na /report!.",
    "~w~Sve komande mozete pronaci na ~r~ /komande.",
    "~w~Uzivajte igrajuci na Yugoslavia RolePlay serveru!",
    "~w~Trenutna verzija moda je~r~ v2.0",
"~w~Ukoliko imate bug, kucajte ~r~/osvezi~w~ili kontaktirajte~r~Admine!" };
//---------------------------------------------------------------------------- > RandomMessages CallBack
public RandomMessage()
{
        TextDrawSetString(Textdraw5, RandomMessages[random(sizeof(RandomMessages))]);
        return 1;
}
//---------------------------------------------------------------------------- > OnPlayerSpawn
public OnPlayerSpawn(playerid)
{

    TextDrawShowForPlayer(playerid, Textdraw3);
    TextDrawShowForPlayer(playerid, Textdraw5);
    TextDrawShowForPlayer(playerid, Textdraw6);
    TextDrawShowForPlayer(playerid, Textdraw7);
    TextDrawShowForPlayer(playerid, Textdraw8);
    TextDrawShowForPlayer(playerid, Textdraw9);
   
return 1;
}
//-------------------------------------------------------------------------> > > Kraj!
Naslov: Odg: [Pomoc]Desni gornji "ćošak"
Poruka od: MiljanIlic poslato Januar 07, 2015, 00:46:01 PRE PODNE
To je FS ja mislim ServerPoruke ili RandomPoruke,  imao sam je i ja pa isto tako poruke nisu radile.  Ako hoces da rade dodaj timer.  Pozz
Naslov: Odg: [Pomoc]Desni gornji "ćošak"
Poruka od: Deko poslato Januar 07, 2015, 10:15:43 PRE PODNE
Gdje tacno da dodam timer?
Naslov: Odg: [Pomoc]Desni gornji "ćošak"
Poruka od: mario_cacic poslato Januar 07, 2015, 10:24:48 PRE PODNE
pod public OnGameModeInit
Naslov: Odg: [Pomoc]Desni gornji "ćošak"
Poruka od: Deko poslato Januar 07, 2015, 10:33:24 PRE PODNE
Evo dodje ovoo
http://i.imgur.com/5HUNvjn.png
Treba skrtipta cijela


#include <a_samp>
#include <YSI\y_ini>
#include <zcmd>
//
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_SUCCESS_1 3
#define DIALOG_SUCCESS_2 4
#define PATH "/Users/%s.ini"
#define COL_WHITE "{FFFFFF}"
#define COL_RED "{F81414}
#define COL_GREEN "{00FF22}"
#define COL_LIGHTBLUE "{00CED1}"
//
forward RandomPorukee();
forward LoadUser_data(playerid,name[],value[]);

enum pInfo
{
pPassword,
pNovac,
pAdmin,
pGameSage,
pUbistva,
pUmiranje
}
new PlayerInfo[MAX_PLAYERS][pInfo];
new Text:RandomPorukeTD;
new RandomPoruke[][] =
{
    "~y~Poruke: ~w~Dobrodosli na ~r~ Binary Team, nadamo se da ce vam se svidjeti",
    "~y~Poruke: ~w~Verzija moda ~y~ v.0.0.1",
    "~y~Poruke: ~w~ Za vidjeti komande ukucajte ~y~ /help"
}
//
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Password",PlayerInfo[playerid][pPassword]);
INI_Int("Novac",PlayerInfo[playerid][pNovac]);
INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
INI_Int("GameSage",PlayerInfo[playerid][pGameSage]);
INI_Int("Ubistva",PlayerInfo[playerid][pUbistva]);
INI_Int("Umiranje",PlayerInfo[playerid][pUmiranje]);
return 1;
}

public OnPlayerConnect(playerid)
{
if(fexist(UserPath(playerid)))
{
    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login","Upisite svoj password za logiranje.", "Ok", "Close");
}
else
{
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,""COL_WHITE"Registracija...",""COL_WHITE"Upisite zeljeni pasword za registraciju novog accounta","Registriraj","Izadji");
}
return 1;
}
//
public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
{
switch( dialogid )
{
case DIALOG_REGISTER:
{
if(!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER,DIALOG_STYLE_INPUT, "Registracija","Unijeliste netacan password.\nUnesite password za registraciju novog accounta.","Registriraj","Izadji");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"Datum");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Novac",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Ubistva",0);
INI_WriteInt(File,"Umiranje",0);
INI_Close(File);

    SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Dobrodosli!",""COL_GREEN"Cestitamo!Uspjesno ste se registrovali na nas server","Ok","");
}
}
case DIALOG_LOGIN:
{
if(!response) return Kick(playerid);
if ( response )
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPassword])
{
INI_ParseFile(UserPath(playerid),"LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pNovac]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_INPUT,"Login","Upisali ste netacan password.\nUpisite vas password za logiranje","Login","Quit");
}
}
}
}
return 1;
}
//new
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"Datum");
INI_WriteInt(File,"Novac",GetPlayerMoney(playerid));
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"GameSage",PlayerInfo[playerid][pGameSage]);
INI_WriteInt(File,"Ubistva",PlayerInfo[playerid][pUbistva]);
INI_WriteInt(File,"Umiranje",PlayerInfo[playerid][pUmiranje]);
INI_Close(File);
return 1;
}
//
public OnPlayerDeath(playerid, killerid, reason)
{
PlayerInfo[killerid][pUbistva]++;
PlayerInfo[playerid][pUmiranje]++;
return 1;
}
//

public OnGameModeInit()
{
    AddPlayerClass(115,-2706.3389,376.4221,4.9685,184.6980,0,0,0,0,0,0); //
    AddStaticVehicleEx(411,2025.9000000,1351.1000000,10.6000000,272.0000000,114,42,15); //Infernus
AddStaticVehicleEx(576,1834.5000000,-1870.6000000,13.1000000,0.0000000,170,173,15); //Tornado
AddStaticVehicleEx(576,-2676.8000000,364.2000100,4.2000000,0.0000000,14,49,15); //Tornado
AddStaticVehicleEx(550,-2681.5000000,363.7999900,4.3000000,0.0000000,101,106,15); //Sunrise
AddStaticVehicleEx(580,-2687.1001000,363.7999900,4.3000000,0.0000000,48,79,15); //Stafford
AddStaticVehicleEx(500,-2691.7000000,363.7000100,4.6000000,0.0000000,63,62,15); //Mesa
AddStaticVehicleEx(434,-2698.3000000,347.6000100,4.6000000,0.0000000,93,126,15); //Hotknife
AddStaticVehicleEx(424,-2698.3000000,357.2000100,4.3000000,0.0000000,132,4,15); //BF Injection
AddStaticVehicleEx(461,-2726.3000000,363.0000000,4.1000000,0.0000000,37,37,15); //PCJ-600
AddStaticVehicleEx(463,-2723.5000000,362.7999900,4.0000000,0.0000000,105,30,15); //Freeway
AddStaticVehicleEx(521,-2720.8999000,363.1000100,4.1000000,0.0000000,163,173,15); //FCR-900
AddStaticVehicleEx(522,-2719.3999000,363.1000100,4.1000000,0.0000000,215,142,15); //NRG-500
AddStaticVehicleEx(522,-2718.0000000,363.1000100,4.1000000,0.0000000,76,117,15); //NRG-500
AddStaticVehicleEx(521,-2722.3000000,363.0000000,4.1000000,0.0000000,96,26,15); //FCR-900
AddStaticVehicleEx(463,-2724.8999000,363.0000000,4.0000000,0.0000000,22,34,15); //Freeway
AddStaticVehicleEx(461,-2727.5000000,363.2999900,4.1000000,0.0000000,22,34,15); //PCJ-600
AddStaticVehicleEx(429,-2714.2998000,401.7002000,4.1000000,0.0000000,132,4,15); //Banshee
AddStaticVehicleEx(411,-2714.1001000,392.8999900,4.2000000,0.0000000,114,42,15); //Infernus
AddStaticVehicleEx(415,-2698.8999000,400.5000000,4.2000000,0.0000000,109,108,15); //Cheetah
AddStaticVehicleEx(451,-2698.8999000,392.7000100,4.1000000,0.0000000,32,32,15); //Turismo
AddStaticVehicleEx(480,-2734.8000000,387.2000100,4.2000000,182.0000000,154,167,15); //Comet
AddStaticVehicleEx(541,-2729.2000000,387.2000100,4.1000000,182.0000000,170,173,15); //Bullet
AddStaticVehicleEx(559,-2723.5000000,387.6000100,4.1000000,180.0000000,48,79,15); //Jester
AddStaticVehicleEx(560,-2717.7000000,387.2999900,4.2000000,180.0000000,115,46,15); //Sultan
AddStaticVehicleEx(409,-2714.1001000,355.0000000,4.3000000,180.0000000,245,245,15); //Stretch
AddStaticVehicleEx(471,-2729.8000000,363.2999900,4.0000000,0.0000000,96,26,15); //Quad
AddStaticVehicleEx(471,-2732.1001000,363.2999900,4.0000000,0.0000000,155,139,15); //Quad
AddStaticVehicleEx(468,-2734.5000000,363.3999900,4.2000000,0.0000000,157,152,15); //Sanchez
AddStaticVehicleEx(468,-2737.3000000,363.2999900,4.2000000,0.0000000,132,4,15); //Sanchez
AddStaticVehicleEx(411,1840.9000000,-1871.1000000,13.2000000,0.0000000,34,52,15); //Infernus
CreateObject(1215,-2708.1001000,378.1000100,11.5000000,0.0000000,0.0000000,0.0000000); //object(bollardlight) (1)
CreateObject(1215,-2704.5000000,374.2000100,9.5000000,0.0000000,0.0000000,0.0000000); //object(bollardlight) (2)
CreateObject(1257,-2741.6001000,403.7999900,4.6000000,0.0000000,0.0000000,0.0000000); //object(bustopm) (1)
CreateObject(1571,-2687.0000000,384.5000000,4.7000000,0.0000000,0.0000000,0.0000000); //object(cj_noodle_1) (1)
CreateObject(924,-2684.3999000,385.7999900,3.5000000,0.0000000,0.0000000,0.0000000); //object(fruitcrate3) (1)
CreateObject(14467,-2608.3999000,369.6000100,-127.9000000,0.0000000,0.0000000,92.0000000); //object(carter_statue) (1)
CreateObject(1363,-2716.8999000,344.3999900,4.3000000,0.0000000,0.0000000,0.0000000); //object(cj_phone_kiosk) (1)
CreateObject(3877,-2716.3000000,405.7999900,5.5000000,0.0000000,0.0000000,0.0000000); //object(sf_rooflite) (1)
CreateObject(3877,-2696.3000000,405.7000100,5.5000000,0.0000000,0.0000000,0.0000000); //object(sf_rooflite) (2)
CreateObject(3877,-2716.3000000,345.5000000,5.6000000,0.0000000,0.0000000,0.0000000); //object(sf_rooflite) (3)
CreateObject(3877,-2696.2000000,345.8999900,5.6000000,0.0000000,0.0000000,0.0000000); //object(sf_rooflite) (4)
CreateObject(3877,-2673.2000000,360.1000100,5.6000000,0.0000000,0.0000000,0.0000000); //object(sf_rooflite) (5)
CreateObject(3877,-2673.3999000,391.1000100,5.5000000,0.0000000,0.0000000,0.0000000); //object(sf_rooflite) (6)
CreateObject(3877,-2738.8999000,391.0000000,5.5000000,0.0000000,0.0000000,0.0000000); //object(sf_rooflite) (7)
CreateObject(3877,-2739.0000000,360.2000100,5.6000000,0.0000000,0.0000000,0.0000000); //object(sf_rooflite) (8)
    SetTimer("RandomMessage", 5000, 1);
return 1;
}

//
stock UserPath(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),PATH,playername);
return string;
}
//
stock udb_hash(buf[])
{
    new
length = strlen(buf),
    s1 = 1,
    s2 = 0,
    n;
    for (n = 0; n < length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}
//

public RandomPorukee()
{
    TextDrawSetString(RandomPorukeTD, RandomPoruke[random(sizeof(RandomPoruke))]);
    return 1;
    }
TextDrawShowForPlayer(playerid, RandomPorukeTD);

RandomPorukeTD = TextDrawCreate(18.000000, 437.000000, "~y~Poruke");
TextDrawBackgroundColor(RandomPorukeTD, 255);
TextDrawFont(RandomPorukeTD, 2);
TextDrawLetterSize(RandomPorukeTD, 0.270000, 1.000000);
TextDrawColor(RandomPorukeTD, -1);
TextDrawSetOutline(RandomPorukeTD, 0);
TextDrawSetProportional(RandomPorukeTD, 1);
TextDrawSetShadow(RandomPorukeTD, 0);
Naslov: Odg: [Pomoc]Desni gornji "ćošak"
Poruka od: mario_cacic poslato Januar 07, 2015, 10:48:31 PRE PODNE
pa jel vidis di stavljas forwarde
Naslov: Odg: [Pomoc]Desni gornji "ćošak"
Poruka od: Deko poslato Januar 07, 2015, 10:49:34 PRE PODNE
Pa sta sad trebam popraviti? xd
Naslov: Odg: [Pomoc]Desni gornji "ćošak"
Poruka od: mario_cacic poslato Januar 07, 2015, 10:54:56 PRE PODNE
pa vidis gresaka ispod public ovog za randommasages  zasto si tu stavio Texdraw RandomPorukeTD
Naslov: Odg: [Pomoc]Desni gornji "ćošak"
Poruka od: Deko poslato Januar 07, 2015, 11:01:46 PRE PODNE
Tako nasao na jednom TuTu de vidi pls koji tut al da je ispravan :D,potrazit cu i ja
Naslov: Odg: [Pomoc]Desni gornji "ćošak"
Poruka od: mario_cacic poslato Januar 07, 2015, 11:27:08 PRE PODNE
I textdraw-ove stavljas pod public OnGameModeInit a ne ispod tog publica sto si ti dodao :)