Wysłany: 2013-02-03, 10:37
PGT-Karmazyn
Wiek: 29 Na forum: 4893 dni Posty: 40
Nick w MP: Karmazyn
Witam! Mam problem.
Poniewa? ucz? si? PAWN, to tworz? podstawowe komendy. Chcia?em zrobi? skrypt na granice. Gdy podjad? samochodem w markera wy?wietla mi si? "Witamy! Chcesz jecha? dalej zap?a?", czy co? w tym stylu. Gdy klikn? na "P?ac?" to otwiera mi si? brama na 7 sekund. I mam kilka problem?w:
1. Jakie ID ma marker? Bo p?ki co mam ikon? "$".
2. Jak zrobi?, ?e gdy wjad? autem to wy?wietla mi si? to. Ja musz? z pojazdu wysi??? i dopiero to si? wy?wietla.
3. Zrobi? tak, ?e gdy klikn? "p?ac?" otwiera mi si? brama na 7 sekund, a nast?pnie automatycznie zamyka.
Przypominam ?e chc? to wykona? w GUI.
Kod mojej mapki testowej:
Kod:
#include <a_samp>
new string[256];
new pName[30];
new pickup[1];
new brama[1];
#define COLOR_BT 0x039DF8FF
#define COLOR_SA 0x6666FF
#define COLOR_LLL 0x993300AA
#define COLOR_GRAD 0xAAAAAAFF
#define BEZOWY 0xFFFFADAA
#define BIALY 0xFFFFFFAA
#define BORDOWY 0x99001FAA
#define BRAZOWY 0x997A00AA
#define CIEMNY_ZIELONY 0x336633AA
#define CZARNY 0x000000AA
#define CZERWONY 0xFF0000AA
#define FIOLETOWY 0x9E3DFFAA
#define NIEBIESKI 0x0000FFAA
#define POMARANCZOWY 0xFF8000AA
#define ROZOWY 0xFF66CCAA
#define SZARY 0xB0B0B0AA
#define ZIELONY 0x00CC00AA
#define ZOLTY 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_FIOLET 0x8000FFFF
#define COLOR_LIGHTBLUE 0x6DC5F3FF
#define COLOR_LIGHTYELLOW 0xFAEAA9FF
#define COLOR_LIGHTGREEN 0x00FF00FF
#define COLOR_LIGHTORANGE 0xF7A26FFF
#define COLOR_LIGHTRED 0xFF0000FF
#define COLOR_RED 0xAA3333AA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_RED 0xAA3333AA
#define RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_YELLOW2 0xFFFF00FF
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_NIEBIESKI 0x0000BBAA
#define COLOR_SYSTEM 0xEFEFF7AA
#define COLOR_PINK 0xFF66FFAA
#define SPAWN_DELAY 3000
#define COLOR_KOMENDA 0xC83322FF
#define COLOR_GRAD1 0xC83322FF
#define COLOR_WIADOMOSC 0x00FF00FF
#define COLOR_BLACK 0x000000FF
#define COLOR_ADMIN 0xFF0000AA
#define COLOR_LIME 0x1FFF06FF
#define COLOR_GD 0xfee7a0FF
// pragma
#pragma tabsize 0
#define pawner Wiarygodny
#define author Karmazyn
#define version 0.1
#define date 14.01.2013
#define time 14:20
public OnGameModeInit()
{
brama[0] = CreateObject(980,1742.69921875,856.19921875,11.300000190735,0,0,270);
pickup[0] = CreatePickup(1274, 2, 1750.5, 856.5, 9.5);
UsePlayerPedAnims();
AddStaticVehicle(411,1800.0000,1080.0000,15.0000,270,0,0);
SetGameModeText("Karmazyn");
AddPlayerClass(15, 1706.8000, 1025.8000, 10.5000, 0, 0, 0, 0, 0, 0, 0);
AddPlayerClass(45, 1706.8000, 1025.8000, 10.5000, 0, 0, 0, 0, 0, 0, 0);
AddPlayerClass(65, 1706.8000, 1025.8000, 10.5000, 0, 0, 0, 0, 0, 0, 0);
AddPlayerClass(7, 1706.8000, 1025.8000, 10.5000, 0, 0, 0, 0, 0, 0, 0);
AddPlayerClass(5, 1706.8000, 1025.8000, 10.5000, 0, 0, 0, 0, 0, 0, 0);
AddPlayerClass(116, 1706.8000, 1025.8000, 10.5000, 0, 0, 0, 0, 0, 0, 0);
AddPlayerClass(115, 1706.8000, 1025.8000, 10.5000, 0, 0, 0, 0, 0, 0, 0);
// Granica Obiekty
CreateObject(16092, 1743.4000244141, 842.79998779297, 5, 0, 0, 0);
CreateObject(16092, 1743.4000244141, 856.40002441406, 7, 0, 0, 0);
CreateObject(16092, 1743.4000244141, 829.40002441406, 7, 0, 0, 0);
CreateObject(16092, 1745.5, 829.59997558594, 7, 0, 0, 0);
CreateObject(16092, 1749.6999511719, 829.59997558594, 7, 0, 0, 0);
CreateObject(16092, 1751.5, 829.70001220703, 7, 0, 0, 0);
CreateObject(16092, 1745.1999511719, 856.59997558594, 7, 0, 0, 0);
CreateObject(16092, 1750.3000488281, 856.79998779297, 7, 0, 0, 0);
CreateObject(16092, 1752.8000488281, 857.20001220703, 7, 0, 0, 0);
CreateObject(16092, 1745.5, 842.79998779297, 5, 0, 0, 0);
CreateObject(16092, 1750, 842.79998779297, 5, 0, 0, 0);
CreateObject(16092, 1752, 842.79998779297, 5, 0, 0, 0);
CreateObject(16092, 1746.5999755859, 843.20001220703, 3.2000000476837, 358, 0, 90);
CreateObject(4639, 1747.6999511719, 849.40002441406, 10.39999961853, 0, 358.89999389648, 0);
CreateObject(4639, 1747.8000488281, 836.5, 10.39999961853, 0, 1.1000061035156, 180);
CreateObject(4639, 1747.9000244141, 863.5, 10.60000038147, 0, 358.89999389648, 0);
CreateObject(4639, 1747.6999511719, 822.59997558594, 10.60000038147, 0, 1.1000061035156, 180);
return 1;
}
public OnPlayerConnect(playerid)
{
GetPlayerName(playerid, pName, 30);
format(string, sizeof(string), "Gracz {FF0000}%s {FFF0F5}[{FF0000}%d{FFF0F5}] do??czy? do serwera!",pName, playerid);
SendClientMessageToAll(COLOR_WHITE, string);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
format(string, sizeof(string), "Gracz {FF0000}%s {FFF0F5}[{FF0000}%d{FFF0F5}] zako?czy? po??czenie z serwerem!",pName, playerid);
SendClientMessageToAll(COLOR_WHITE, string);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1797.3000, 1046.9000, 6.4000);
SetPlayerCameraPos(playerid, 1797.2998, 1028.3994, 6.4000);
SetPlayerCameraLookAt(playerid, 1797.3000, 1046.9000, 6.4000);
return 1;
}
public OnPlayerText(playerid, text[])
{
SetPlayerChatBubble(playerid, text, COLOR_WHITE, 100.0, 10000);
new dupa[256], nick[MAX_PLAYER_NAME];
GetPlayerName(playerid, nick, sizeof(nick));
if(IsPlayerAdmin(playerid))
{
if(strcmp(nick, "Karmazyn", true)== 0)
format(dupa, sizeof(dupa), "({FF0000}Head Administrator{E6E6FA} [ID: %d]): %s", playerid, text);
else
format(dupa, sizeof(dupa), "({FFB90F}Administrator Serwera{E6E6FA} [ID: %d]): %s", playerid, text);
SendPlayerMessageToAll(playerid, dupa);
if(!IsPlayerAdmin(playerid))
format(dupa, sizeof(dupa),"(ID: %d): %s", playerid, text);
SendPlayerMessageToAll(playerid, dupa);
}
return 0;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/zycie", true)==0)
{
SetPlayerHealth(playerid, 100);
GivePlayerMoney(playerid, -5000);
SendClientMessage(playerid, COLOR_YELLOW,"Twoje ?ycie zregenerowa?o si?. Otrzyma?e? 100hp za 5.000$!");
return 1;
}
if (strcmp(cmdtext, "/kamizelka", true)==0)
{
SetPlayerArmour(playerid, 100);
GivePlayerMoney(playerid, -10000);
SendClientMessage(playerid, COLOR_YELLOW,"Zakupi?e? kamizelke za 10.000$!");
return 1;
}
if (strcmp(cmdtext, "/gin", true)==0)
{
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid, COLOR_YELLOW,"Zgon.");
return 1;
}
if (strcmp(cmdtext, "/kasa", true)==0)
{
GivePlayerMoney(playerid, 1000);
SendClientMessage(playerid, COLOR_YELLOW,"Otrzyma?e? 1.000$.");
return 1;
}
if (strcmp(cmdtext, "/bron", true)==0)
{
GivePlayerWeapon(playerid, 46, 10000);
GivePlayerWeapon(playerid, 43, 10000);
GivePlayerWeapon(playerid, 32, 10000);
GivePlayerWeapon(playerid, 26, 10000);
GivePlayerMoney(playerid, -10000);
SendClientMessage(playerid, COLOR_YELLOW,"Zakupi?e? bro? za 10.000$!");
return 1;
}
if (strcmp(cmdtext, "/tancz", true)==0)
{
ApplyAnimation(playerid,"DANCING","dance_loop",4.1,1,0,0,0,0);
SendClientMessage(playerid, COLOR_YELLOW, "Aby wy??czy? amnimacje, wpisz /astop.");
return 1;
}
if (strcmp(cmdtext, "/astop", true)==0)
{
ClearAnimations(playerid);
return 1;
}
if (strcmp(cmdtext, "/komendy", true)==0)
{
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Komendy", "/zycie - uzupe?nij ?ycie\n/tancz - taniec\n/kill - zabij si?\n/kamizelka - uzupe?niasz pancerz\n/kasa - dostajesz dotacj?\n/bronie - dostajesz bro?\n/about - Info o ostatniej aktualizacji", "Zamknij", "");
return 1;
}
if (strcmp(cmdtext, "/cmd", true)==0)
{
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Komendy", "/zycie - uzupe?nij ?ycie\n/tancz - taniec\n/kill - zabij si?\n/kamizelka - uzupe?niasz pancerz\n/kasa - dostajesz dotacj?\n/bronie - dostajesz bro?\n/about - Info o ostatniej aktualizacji", "Zamknij", "");
return 1;
}
if (strcmp(cmdtext, "/autor", true)==0)
{
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Autorzy mapy:", "Karmazyn & Wiarygodny\nWersja 0.1v\nData ostaniej kompilacji: 01.02.2013 o 13:40 ", "Zamknij", "");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response == 1)
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Granica", "Nie p?acisz? Nie ma przejazdu.", "Zamknij", "");
else
{
GivePlayerMoney(playerid, -27);
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Granica", "Dzi?kuj?! Szerokiej drogi!", "Dzi?kuj?!", "");
}
}
if(dialogid == 2)
{
if(response == 1)
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Granica", "Nie p?acisz? Nie ma przejazdu.", "Zamknij", "");
else
{
GivePlayerMoney(playerid, -52);
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Granica", "Dzi?kuj?! Szerokiej drogi!", "Dzi?kuj?!", "");
}
}
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == pickup[0])
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_MSGBOX, "Granica", "Witaj kierowco!\nMusisz zap?aci? za odcinek autostrady!\nKoszt wynosi 52$.", "Nie p?ac?", "P?ac?");
}
return 1;
}
Oczywi?cie, za ka?d? DZIA?AJ?C? wskaz?wk? PIWO
Wysłany: 2013-02-03, 13:51
carl0987
Wiek: 37 Na forum: 4891 dni Posty: 295
Nick w MP: Lolek
Piwa : 10
musisz poprostu timer da? tak jak w mapie ptr zobacz sobie w obiektach..
Wysłany: 2013-02-03, 14:28
Ghunter
Wiek: 29 Na forum: 5210 dni Posty: 2
Nick w MP: PureZ
Piwa : 208
Zr?b timer, po czym wpisz do skryptu, ?eby po up?ywie czasu brama wr?ci?a na swoje miejsce .
Co do marker?w poszukaj w internecie. Kod: http://gtamultiplayer.pl/samp/pawno/
Nw, czy jest dobre - przeczyta?em tylko, ?e jset
Wysłany: 2013-02-03, 15:03
PGT-Karmazyn
Wiek: 29 Na forum: 4893 dni Posty: 40
Nick w MP: Karmazyn
Ale jak to? Bo wiem, tyle ?e Timer trzeba doda? do public OnGameModeInit. A reszt?? Gdzie i w og?le co?
P.S. A tak zrobi?, ?e jak wjad? pojazdem w pickupa to mi si? wy?wietla wtedy, to jak?
[ Dodano : 2013-02-03, 15:33 ]
Okej. Jednak ju? rozwi?za?em problem z samo zamykaj?c? si? bram?.
Teraz prosz? was o pomoc w:
Jak zrobi?, ?e gdy wjad? autem to wy?wietla mi okno GUI. Ja musz? z pojazdu wysi??? i dopiero si? wy?wietla owe okno.
Oraz:
Jakie ID ma marker? Bo p?ki co mam ikon? $.
Wysłany: 2013-02-03, 19:20
Axel9697
Wiek: 32 Na forum: 5904 dni Posty: 115
Piwa : 44
Aby mo?na by?o "podnosi?" pickup autem, zmie? jego typ na 14.
A modele pickup?w masz tu .
Tagi: otwieranie :: bramy :: przez :: gui
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: