Wysłany: 2013-01-17, 14:25
Norbbert
Wiek: 31 Na forum: 5013 dni Posty: 15
Nick w MP: [SBE]Norbert
Piwa : 2
Witam , robi? modyfikacje mapy IT i chcia?bym zrobi? komendy dla policji w GUI.
Czyli Policjant wpisuj?c komend? /panelp i ma w okienku ,
-S?u?ba
-Mandat
-Reset Zdj??
-Kajdanki
Prosz? o przyk?ad w TuT lub zrobi? bo nie kumam GUI DIALOG_STYLE_LIST
Cytat: CMD:sluzba(playerid, params[])
{
if(GetTeam(playerid) == TEAM_POLICE)
{
if(!GetPVarInt(playerid, "IsWork"))
{
SetPVarInt(playerid, "IsWork", 1);
format(string, sizeof string, ""GCOLOR_WHITE"%s "GCOLOR_GUI"rozpocz??"GCOLOR_WHITE" s?u?b? policyjn?"GCOLOR_GUI".", PlayerName(playerid));
SendClientMessageToAll(GREY, string);
SendClientMessage(playerid, LIGHTGREEN, "S?u?ba policyjna "GCOLOR_WHITE"rozpocz?ta"GCOLOR_GREEN".");
}
else
{
DeletePVar(playerid, "IsWork");
format(string, sizeof string, ""GCOLOR_WHITE"%s "GCOLOR_GUI"zako?czy?"GCOLOR_WHITE" s?u?b? policyjn?"GCOLOR_GUI".", PlayerName(playerid));
SendClientMessageToAll(GREY, string);
SendClientMessage(playerid, LIGHTGREEN, "S?u?ba policyjna "GCOLOR_WHITE"zako?czona"GCOLOR_GREEN".");
}
}
return 1;
}
CMD:mandat(playerid, params[])
{
new forplayerid, money, score;
if(GetTeam(playerid) == TEAM_POLICE)
{
if(sscanf(params,"ddD(0)", forplayerid, money, score))
{
SendClientMessage(playerid, LIGHTRED,"* /mandat [ID] [Kwota] [Punkty]");
}
else
{
if(IsPlayerConnected(forplayerid))
{
if(forplayerid != playerid)
{
if(GetDistancePlayerToPlayer(playerid, forplayerid)<10)
{
if(money < 0) money = 0;
else if(money > 50000) money = 50000;
if(score < 0) score = 0;
else if(score > 100) score = 100;
new Slot = GetPlayerTeamSlot(TEAM_POLICE, PlayerName(playerid));
djSetInt(TeamFile(TEAM_POLICE), GetSlotInfo(Slot, "WorkMandate"), djInt(TeamFile(TEAM_POLICE), GetSlotInfo(Slot, "WorkMandate"))+1);
SetPlayerScore(forplayerid, GetPlayerScore(forplayerid)-score);
GiveMoney(forplayerid, -money);
format(string, sizeof string, ""GCOLOR_GUI"Nick gracza: "GCOLOR_WHITE"%s"GCOLOR_GUI".\nKwota: "GCOLOR_WHITE"%d$"GCOLOR_GUI"\nPunkty: "GCOLOR_WHITE"%d", PlayerName(forplayerid), money, score);
ShowPlayerDialog(playerid, NO_USED_DIALOG, DIALOG_STYLE_MSGBOX, ""GCOLOR_WHITE"Wystawi?e? mandat!", string, "Ok", "");
format(string, sizeof string, ""GCOLOR_GUI"Nick funkcjonariusza:"GCOLOR_WHITE" %s"GCOLOR_GUI".\nKwota: "GCOLOR_WHITE"%d$\nPunkty: "GCOLOR_WHITE"%d", PlayerName(playerid), money, score);
ShowPlayerDialog(forplayerid, NO_USED_DIALOG, DIALOG_STYLE_MSGBOX, ""GCOLOR_WHITE"Otrzyma?e? mandat!", string, "Ok", "");
}
else
{
SendClientMessage(playerid, LIGHTRED,"Jeste? za daleko od gracza.");
}
}
else
{
SendClientMessage(playerid, LIGHTRED,"Nie mo?esz wystawi? mandatu samemu sobie.");
}
}
else
{
SendClientMessage(playerid, LIGHTRED, "Gracz nie jest aktywny.");
}
}
}
return 1;
}
CMD:kontrola(playerid, params[])
{
new forplayerid;
if(GetTeam(playerid) == TEAM_POLICE)
{
if(sscanf(params,"d",forplayerid))
{
SendClientMessage(playerid, LIGHTRED,"* /kontrola [ID]");
}
else
{
if(IsPlayerConnected(forplayerid))
{
if(GetDistancePlayerToPlayer(playerid, forplayerid)<10)
{
if(Belts[forplayerid] == 0)
{
new h, m, s;
ConvertSeconds(GetPVarInt(forplayerid, "DriveTime"),h,m,s);
format(string, sizeof string, ""GCOLOR_GUI"Nick gracza: "GCOLOR_WHITE"%s\n"GCOLOR_GUI"Stan konta TOLL: "GCOLOR_WHITE"%d\n"GCOLOR_GUI"Czas jazdy: "GCOLOR_WHITE"%02d:%02d:%02d\n"GCOLOR_GUI"Zdj?cia: "GCOLOR_WHITE"%d\n"GCOLOR_GUI"Pasy: "GCOLOR_WHITE"Odpi?te", PlayerName(forplayerid), GetViaMoney(forplayerid), h, m, s, GetPVarInt(forplayerid, "Photos"));
ShowPlayerDialog(playerid, NO_USED_DIALOG, DIALOG_STYLE_MSGBOX, ""GCOLOR_WHITE"Kontrola gracza", string, "Zamknij", "");
}
else
{
new h, m, s;
ConvertSeconds(GetPVarInt(forplayerid, "DriveTime"),h,m,s);
format(string, sizeof string, ""GCOLOR_GUI"Nick gracza: "GCOLOR_WHITE"%s\n"GCOLOR_GUI"Stan konta TOLL: "GCOLOR_WHITE"%d\n"GCOLOR_GUI"Czas jazdy: "GCOLOR_WHITE"%02d:%02d:%02d\n"GCOLOR_GUI"Zdj?cia: "GCOLOR_WHITE"%d\n"GCOLOR_GUI"Pasy: "GCOLOR_WHITE"Zapi?te", PlayerName(forplayerid), GetViaMoney(forplayerid), h, m, s, GetPVarInt(forplayerid, "Photos"));
ShowPlayerDialog(playerid, NO_USED_DIALOG, DIALOG_STYLE_MSGBOX, ""GCOLOR_WHITE"Kontrola gracza", string, "Zamknij", "");
}
}
else
{
SendClientMessage(playerid, LIGHTRED,"Jeste? za daleko gracza.");
}
}
else
{
SendClientMessage(playerid, LIGHTRED, "Gracz nie jest aktywny.");
}
}
}
return 1;
}
CMD:rz(playerid, params[])
{
new forplayerid;
if(GetTeam(playerid) == TEAM_POLICE)
{
if(sscanf(params,"d",forplayerid))
{
SendClientMessage(playerid, LIGHTRED,"* /rz [ID]");
}
else
{
if(IsPlayerConnected(forplayerid))
{
if(GetDistancePlayerToPlayer(playerid, forplayerid)<10)
{
SetPVarInt(forplayerid, "Photos", 0);
format(string, sizeof string, "Usun??e? zdj?cia graczowi "GCOLOR_WHITE"%s"GCOLOR_GREEN".", PlayerName(forplayerid));
SendClientMessage(playerid, LIGHTGREEN, string);
format(string, sizeof string, "Funkcjonariusz "GCOLOR_WHITE"%s"GCOLOR_GREEN" zresetowa? Ci zdj?cia.", PlayerName(playerid));
SendClientMessage(forplayerid, LIGHTGREEN, string);
}
else
{
SendClientMessage(playerid, LIGHTRED,"Jeste? za daleko gracza.");
}
}
else
{
SendClientMessage(playerid, LIGHTRED, "Gracz nie jest aktywny.");
}
}
}
return 1;
}
CMD:kajdanki(playerid, params[])
{
if(GetTeam(playerid) == TEAM_POLICE)
{
new forplayerid;
if(sscanf(params, "d", forplayerid))
{
SendClientMessage(playerid, LIGHTRED, "* /kajdanki [ID]");
}
else
{
if(IsPlayerConnected(forplayerid))
{
if(GetDistancePlayerToPlayer(playerid, forplayerid)<200)
{
if(!GetPVarInt(forplayerid, "PoliceLock"))
{
SetPVarInt(forplayerid, "PoliceLock", 1);
TogglePlayerControllable(forplayerid, 0);
SendClientMessage(forplayerid, LIGHTGREEN, "Zosta?e? skuty przez policje.");
format(string, sizeof string, "Sku?e? gracza "GCOLOR_WHITE"%s"GCOLOR_GREEN".", PlayerName(forplayerid));
SendClientMessage(playerid, LIGHTGREEN, string);
}
else
{
SetPVarInt(forplayerid, "PoliceLock", 0);
TogglePlayerControllable(forplayerid, 1);
SendClientMessage(forplayerid, LIGHTGREEN, "Zdj?to Ci kajdanki.");
format(string, sizeof string, "Odku?e? gracza "GCOLOR_WHITE"%s"GCOLOR_GREEN".", PlayerName(forplayerid));
SendClientMessage(playerid, LIGHTGREEN, string);
}
}
else
{
SendClientMessage(playerid, LIGHTRED, "Jeste? za daleko od gracza.");
}
}
else
{
SendClientMessage(playerid, LIGHTRED, "Gracz nie jest aktywny.");
}
}
}
return 1;
}
Wysłany: 2013-01-17, 15:03
mishek
Wiek: 30 Na forum: 5272 dni Posty: 33
Nick w MP: mishek
Piwa : 7
http://pastebin.com/RSP7bx9X
Pozdrawiam.
P.S: Jako? nie jestem przekonany, ?e to zadzia?a.
P.S2: Pope?ni?em b??d : d
Nie ma by? Kod: new nazwa_dialogu id_dialogu
tylko Kod: #define nazwa_dialogu id_dialogu
Wysłany: 2013-01-17, 15:25
B!4CK
Never give UP!
Wiek: 32 Na forum: 5809 dni Posty: 1047
Nick w MP: John
Piwa : 1891
Podpis
Cześć
[you]
!
Projekt, który poruszy scenę platformy SA:MP!
Wysłany: 2013-01-17, 16:12
Norbbert
Wiek: 31 Na forum: 5013 dni Posty: 15
Nick w MP: [SBE]Norbert
Piwa : 2
Czyli tak na g?rnej g?rze mapy np: Kod: #define POLICJA_DIALOG 53
potem : Cytat: ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "caption[] - nag??wek", "info[] - tutaj znajduj? si? opcje\nOddzielamy je poprzez \\n\nKolejna opcja\nI kolejna", "button1", "button2");
A na ko?cu
Kod: public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
//Kod
return 1;
}
Lecz czy nie mo?na wklei? wszystko ko?o siebie znaczy opr?cz define ?
Wysłany: 2013-01-17, 16:19
B!4CK
Never give UP!
Wiek: 32 Na forum: 5809 dni Posty: 1047
Nick w MP: John
Piwa : 1891
Kod: ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, caption[] - nag??wek, info[] - tutaj znajduj? si? opcje\nOddzielamy je poprzez \\n\nKolejna opcja\nI kolejna, button1, button2);
To dajemy do komendy
Zale?y gdzie masz ten public, ale lepiej mie? pouk?adany kod.
Podpis
Cześć
[you]
!
Projekt, który poruszy scenę platformy SA:MP!
Wysłany: 2013-01-17, 16:43
Norbbert
Wiek: 31 Na forum: 5013 dni Posty: 15
Nick w MP: [SBE]Norbert
Piwa : 2
A je?eli dam do uk?adaczu kodu to sam mi poprawi jak dam kody np: ko?o siebie w byle jakim miejscu
Wysłany: 2013-01-17, 16:55
B!4CK
Never give UP!
Wiek: 32 Na forum: 5809 dni Posty: 1047
Nick w MP: John
Piwa : 1891
Wiesz co, szczerze to nie wiem, ale pouk?ada Ci kod i doda brakuj?ce / odejmie klamry.
Podpis
Cześć
[you]
!
Projekt, który poruszy scenę platformy SA:MP!
Tagi: komendy :: dialog_style_list
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: