Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define PARROT_INDEX 0 // SetPlayerAttachedObject slots kuru aizņem papagailis (0-9)
- new stringp[MAX_PLAYERS][256];
- //--- Pie PlayerInfo ---//
- pParrot,
- pParrotName,
- pParrotSentence[5][35],
- //--- Pie ResetNew ---//
- if(PlayerInfo[playerid][pParrot] == 1)
- {
- RemovePlayerAttachedObject(playerid,PARROT_INDEX);
- }
- new string1[2];
- format(string1,sizeof(string1)," ");
- strmid(PlayerInfo[playerid][pParrotSentence][0],string1,0,strlen(string1),255);
- strmid(PlayerInfo[playerid][pParrotSentence][1],string1,0,strlen(string1),255);
- strmid(PlayerInfo[playerid][pParrotSentence][2],string1,0,strlen(string1),255);
- strmid(PlayerInfo[playerid][pParrotSentence][3],string1,0,strlen(string1),255);
- strmid(PlayerInfo[playerid][pParrotSentence][4],string1,0,strlen(string1),255);
- strmid(PlayerInfo[playerid][pParrotName],string1,0,strlen(string1),255);
- PlayerInfo[playerid][pParrot] = 0;
- //--- Pie OnPlayerText ---//
- new Float:X,Float:Y,Float:Z; // sitie varetu ar kaut ko konfliktet ja liec pasa augsa, tapec vai nu liec pasa apaksa vai ari maini mainigos
- for(new p=0;p<MAX_PLAYERS;p++)
- {
- if(PlayerInfo[playerid][pParrot] == 1)
- if(strfind(text,PlayerInfo[p][pParrotName],true)!=-1)
- {
- GetPlayerPos(playerid,X,Y,Z);
- if(IsPlayerInRangeOfPoint(p,20.0,X,Y,Z))
- {
- new sent = random(4);
- switch(sent)
- {
- case 0:
- {
- if(strlen(PlayerInfo[p][pParrotSentence][0]) > 3)
- {
- format(stringp[playerid],256,"%s saka: %s",PlayerInfo[p][pParrotName],PlayerInfo[p][pParrotSentence][0]);
- SetTimerEx("SendParrotMessage",180,0,"i", playerid);
- }
- }
- case 1:
- {
- if(strlen(PlayerInfo[p][pParrotSentence][1]) > 3)
- {
- format(stringp[playerid],256,"%s saka: %s",PlayerInfo[p][pParrotName],PlayerInfo[p][pParrotSentence][1]);
- SetTimerEx("SendParrotMessage",180,0,"i", playerid);
- }
- }
- case 2:
- {
- if(strlen(PlayerInfo[p][pParrotSentence][2]) > 3)
- {
- format(stringp[playerid],256,"%s saka: %s",PlayerInfo[p][pParrotName],PlayerInfo[p][pParrotSentence][2]);
- SetTimerEx("SendParrotMessage",180,0,"i", playerid);
- }
- }
- case 3:
- {
- if(strlen(PlayerInfo[p][pParrotSentence][3]) > 3)
- {
- format(stringp[playerid],256,"%s saka: %s",PlayerInfo[p][pParrotName],PlayerInfo[p][pParrotSentence][3]);
- SetTimerEx("SendParrotMessage",180,0,"i", playerid);
- }
- }
- case 4:
- {
- if(strlen(PlayerInfo[p][pParrotSentence][4]) > 3)
- {
- format(stringp[playerid],256,"%s saka: %s",PlayerInfo[p][pParrotName],PlayerInfo[p][pParrotSentence][4]);
- SetTimerEx("SendParrotMessage",180,0,"i", playerid);
- }
- }
- }
- }
- }
- }
- /////////////////////////////
- forward SendParrotMessage(playerid);
- public SendParrotMessage(playerid)
- {
- ProxDetector(20.0, playerid, stringp[playerid],COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- //////// KOMANDAS
- CMD:pmenu(playerid)
- {
- if(PlayerLogged[playerid] == 0) return 1;
- if(!Inventory_HasItem(playerid, "Papagailis")) return SendClientMessage(playerid, COLOR_LIGHTRED, "Tev nav papagaiļa!");
- Dialog_Show(playerid,PARROTMENU,2,"Papagaiļa darbības","1. Mainīt papagaiļa vārdu\n2. Iemācīt papagailim frāzes\n3. Noņemt/Uzlikt papagaili","Izvēlēties", "Atcelt");
- SendClientMessage(playerid, COLOR_ORANGE, "Atceries: Papagaiļa vārds un frāzes ir jāliek pēc katra RR no jauna!");
- return 1;
- }
- CMD:papagailis(playerid)
- {
- if(PlayerLogged[playerid] == 0) return 1;
- if(PlayerInfo[playerid][pAdmin] < 1337 || AdminLogged[playerid] == false) return 1;
- Inventory_Add(playerid, "Papagailis", 19078);
- return 1;
- }
- ///////// DIALOGI
- Dialog:PARROTMENU(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- if(listitem == 0)
- {
- Dialog_Show(playerid,PARROTMENU+1,DIALOG_STYLE_INPUT,"Papagaiļa vārds","Papagailis runās, kad tiks pieminēts viņa vārds. (3-20 simboli)","Uzstādīt","");
- }
- else if(listitem == 1)
- {
- new string1[256];
- format(string1,sizeof(string1),"1.%s\n2.%s\n3.%s\n4.%s\n5.%s",
- PlayerInfo[playerid][pParrotSentence][0],
- PlayerInfo[playerid][pParrotSentence][1],
- PlayerInfo[playerid][pParrotSentence][2],
- PlayerInfo[playerid][pParrotSentence][3],
- PlayerInfo[playerid][pParrotSentence][4]);
- Dialog_Show(playerid,PARROTMENU+2,DIALOG_STYLE_LIST,"Papagaiļa frāzes",string1,"Mainīt","Atcelt");
- }
- else if(listitem == 2)
- {
- Dialog_Show(params[0],PARROTMENU+3,0,"Papagailis","Ko vēlaties darīt?", "Uzlikt", "Noņemt");
- }
- }
- return 1;
- }
- Dialog:PARROTMENU+1(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- if(strlen(inputtext) < 3 || strlen(inputtext) > 20)
- {
- Dialog_Show(playerid,PARROTMENU+1,DIALOG_STYLE_INPUT,"Papagaiļa vārds","Papagailis runās, kad tiks pieminēts viņa vārds. (3-20 simboli)","Uzstādīt","");
- }
- else
- {
- strmid(PlayerInfo[playerid][pParrotName],inputtext,0,strlen(inputtext),255);
- SendClientMessage(playerid,COLOR_ORANGE,"Papagaiļa vārds tika veiskmīgi nomainīts!");
- }
- }
- else
- {
- Dialog_Show(playerid,PARROTMENU+1,DIALOG_STYLE_INPUT,"Papagaiļa vārds","Papagailis runās, kad tiks pieminēts viņa vārds. (3-20 simboli)","Uzstādīt","");
- }
- return 1;
- }
- Dialog:PARROTMENU+2(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- if(listitem == 0)
- {
- Dialog_Show(playerid,PARROT,DIALOG_STYLE_INPUT,"Mainīt frāzi","Frāzei ir jabūt 3-35 simbolu garai.","Mainīt","Atcelt");
- }
- else if(listitem == 1)
- {
- Dialog_Show(playerid,PARROT+1,DIALOG_STYLE_INPUT,"Mainīt frāzi","Frāzei ir jabūt 3-35 simbolu garai.","Mainīt","Atcelt");
- }
- else if(listitem == 2)
- {
- Dialog_Show(playerid,PARROT+2,DIALOG_STYLE_INPUT,"Mainīt frāzi","Frāzei ir jabūt 3-35 simbolu garai.","Mainīt","Atcelt");
- }
- else if(listitem == 3)
- {
- Dialog_Show(playerid,PARROT+3,DIALOG_STYLE_INPUT,"Mainīt frāzi","Frāzei ir jabūt 3-35 simbolu garai.","Mainīt","Atcelt");
- }
- else if(listitem == 4)
- {
- Dialog_Show(playerid,PARROT+4,DIALOG_STYLE_INPUT,"Mainīt frāzi","Frāzei ir jabūt 3-35 simbolu garai.","Mainīt","Atcelt");
- }
- }
- return 1;
- }
- Dialog:PARROTMENU+3(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- SetPlayerAttachedObject(playerid,PARROT_INDEX,19078,1,0.320722,-0.067912,-0.165151,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000); // Parrot
- PlayerInfo[playerid][pParrot] = 1;
- SendClientMessage(playerid,COLOR_ORANGE,"Papagailis tika uzlikts uz pleca.");
- Inventory_Remove(playerid, "Papagailis");
- }
- else
- {
- RemovePlayerAttachedObject(playerid,PARROT_INDEX);
- PlayerInfo[playerid][pParrot] = 0;
- SendClientMessage(playerid,COLOR_ORANGE,"Papagailis tika noņemts no pleca.");
- Inventory_Add(playerid, "Papagailis", 19078);
- }
- return 1;
- }
- Dialog:PARROT(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- if(strlen(inputtext) < 3 || strlen(inputtext) > 35)
- {
- Dialog_Show(playerid,PARROT,DIALOG_STYLE_INPUT,"Mainīt frāzi","Frāzei ir jabūt 3-35 simbolu garai.","Mainīt","Atcelt");
- }
- else
- {
- strmid(PlayerInfo[playerid][pParrotSentence][0],inputtext,0,strlen(inputtext),255);
- SendClientMessage(playerid,COLOR_ORANGE,"Papagaiļa frāze tika veiksmīgi nomainīta!");
- }
- }
- return 1;
- }
- Dialog:PARROT+1(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- if(strlen(inputtext) < 3 || strlen(inputtext) > 35)
- {
- Dialog_Show(playerid,PARROT+1,DIALOG_STYLE_INPUT,"Mainīt frāzi","Frāzei ir jabūt 3-35 simbolu garai.","Mainīt","Atcelt");
- }
- else
- {
- strmid(PlayerInfo[playerid][pParrotSentence][1],inputtext,0,strlen(inputtext),255);
- SendClientMessage(playerid,COLOR_ORANGE,"Papagaiļa frāze tika veiksmīgi nomainīta!");
- }
- }
- return 1;
- }
- Dialog:PARROT+2(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- if(strlen(inputtext) < 3 || strlen(inputtext) > 35)
- {
- Dialog_Show(playerid,PARROT+2,DIALOG_STYLE_INPUT,"Mainīt frāzi","Frāzei ir jabūt 3-35 simbolu garai.","Mainīt","Atcelt");
- }
- else
- {
- strmid(PlayerInfo[playerid][pParrotSentence][2],inputtext,0,strlen(inputtext),255);
- SendClientMessage(playerid,COLOR_ORANGE,"Papagaiļa frāze tika veiksmīgi nomainīta!");
- }
- }
- return 1;
- }
- Dialog:PARROT+3(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- if(strlen(inputtext) < 3 || strlen(inputtext) > 35)
- {
- Dialog_Show(playerid,PARROT+3,DIALOG_STYLE_INPUT,"Mainīt frāzi","Frāzei ir jabūt 3-35 simbolu garai.","Mainīt","Atcelt");
- }
- else
- {
- strmid(PlayerInfo[playerid][pParrotSentence][3],inputtext,0,strlen(inputtext),255);
- SendClientMessage(playerid,COLOR_ORANGE,"Papagaiļa frāze tika veiksmīgi nomainīta!");
- }
- }
- return 1;
- }
- Dialog:PARROT+4(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- if(strlen(inputtext) < 3 || strlen(inputtext) > 35)
- {
- Dialog_Show(playerid,PARROT+4,DIALOG_STYLE_INPUT,"Mainīt frāzi","Frāzei ir jabūt 3-35 simbolu garai.","Mainīt","Atcelt");
- }
- else
- {
- strmid(PlayerInfo[playerid][pParrotSentence][4],inputtext,0,strlen(inputtext),255);
- SendClientMessage(playerid,COLOR_ORANGE,"Papagaiļa frāze tika veiksmīgi nomainīta!");
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement