lordhell12 Posted June 23, 2015 Report Share Posted June 23, 2015 (edited) Salutare,comanda PM pe care o am eu in gamemode este toata un dialog,cand trimiti si cand primesti.Vreau sa ma ajutati sa o fac sa se execute in chat nu intr-un dialog.Aceasta este functia:function OnPMReceived(playerid, Receiver, text[]) { new Str[1000], Str2[1000], Str3[200], Str4[129]; //-------------------------------------------------------------------------- format(Str4, sizeof(Str4), "*** PM: %s To %s: %s ***", PlayerName(playerid), PlayerName(Receiver), text); //-------------------------------------------------------------------------- if(ServerInfo[ReadPMs] == 1) MessageToAdmins(COLOR_GREY, Str4); //-------------------------------------------------------------------------- PlayerInfo[Receiver][PMID] = playerid; //-------------------------------------------------------------------------- format(Str2, sizeof(Str2), "{00FF00}Hi, {FF0000}%s{00FF00}!\n", PlayerName(Receiver)), strcat(Str, Str2, sizeof(Str)); format(Str2, sizeof(Str2), "{FF0000}%s {00FF00}sent you a {00BBF6}Personal Message{00FF00}:\n", PlayerName(playerid)), strcat(Str, Str2, sizeof(Str)); format(Str2, sizeof(Str2), "{FFCC00}%s", text), strcat(Str, Str2, sizeof(Str)); //-------------------------------------------------------------------------- format(Str2, sizeof(Str2), "{AFAFAF}Send a Message to {FF0000}%s", PlayerName(playerid)), strcat(Str3, Str2, sizeof(Str3)); //-------------------------------------------------------------------------- return ShowPlayerDialog(Receiver, DIALOG_PM, DIALOG_STYLE_INPUT, Str3, Str, "Send", "Close");iar aceasta este comanda:} CMD:pm(playerid,params[]) { new Str[129], Str2[128], Str3[129]; //-------------------------------------------------------------------------- if(sscanf(params, "u", PlayerInfo[playerid][PMID])) return SendUsage(playerid, "/PM [PlayerID]"); //-------------------------------------------------------------------------- if(IsPlayerConnected(PlayerInfo[playerid][PMID]) && PlayerInfo[playerid][PMID] != INVALID_PLAYER_ID) { //---------------------------------------------------------------------- if(PlayerInfo[playerid][PMID] == playerid) return SendError(playerid, "You cannot PM yourself!"); //---------------------------------------------------------------------- if(PlayerInfo[playerid][Muted] == 1) return Announce(playerid, "~w~~h~You are ~r~~h~muted~w~~h~!", 3000, 4), false; //---------------------------------------------------------------------- if(PlayerInfo[PlayerInfo[playerid][PMID]][Ignore_PM] == 1 && PlayerInfo[playerid][Level] <= 3) return SendError(playerid, "This player have /Ignore PM On!"); //---------------------------------------------------------------------- format(Str2, sizeof(Str2), "{00FF00}Hi, {FF0000}%s{00FF00}!\n", PlayerName(playerid)); strcat(Str, Str2, sizeof(Str)); format(Str2, sizeof(Str2), "{00FF00}Please type before the message you want to send to {00BBF6}%s{00FF00}!", PlayerName(PlayerInfo[playerid][PMID])); strcat(Str, Str2, sizeof(Str)); //------------------------------------------------------------------ format(Str2, sizeof(Str2), "{AFAFAF}Send a Private Message to {FF0000}%s", PlayerName(PlayerInfo[playerid][PMID])); strcat(Str3, Str2, sizeof(Str3)); //---------------------------------------------------------------------- return ShowPlayerDialog(playerid, DIALOG_PM, DIALOG_STYLE_INPUT, Str3, Str, "Send", "Close"); } else return SendError2(playerid, "Player not connected!", "Jucatorul nu este conectat!"); } Edited June 23, 2015 by lordhell12 Link to comment Share on other sites More sharing options...
WiDuAlK Posted June 23, 2015 Report Share Posted June 23, 2015 Salutare,comanda PM pe care o am eu in gamemode este toata un dialog,cand trimiti si cand primesti.Vreau sa ma ajutati sa o fac sa se execute in chat nu intr-un dialog.Aceasta este functia:function OnPMReceived(playerid, Receiver, text[]) { new Str[1000], Str2[1000], Str3[200], Str4[129]; //-------------------------------------------------------------------------- format(Str4, sizeof(Str4), "*** PM: %s To %s: %s ***", PlayerName(playerid), PlayerName(Receiver), text); //-------------------------------------------------------------------------- if(ServerInfo[ReadPMs] == 1) MessageToAdmins(COLOR_GREY, Str4); //-------------------------------------------------------------------------- PlayerInfo[Receiver][PMID] = playerid; //-------------------------------------------------------------------------- format(Str2, sizeof(Str2), "{00FF00}Hi, {FF0000}%s{00FF00}!\n", PlayerName(Receiver)), strcat(Str, Str2, sizeof(Str)); format(Str2, sizeof(Str2), "{FF0000}%s {00FF00}sent you a {00BBF6}Personal Message{00FF00}:\n", PlayerName(playerid)), strcat(Str, Str2, sizeof(Str)); format(Str2, sizeof(Str2), "{FFCC00}%s", text), strcat(Str, Str2, sizeof(Str)); //-------------------------------------------------------------------------- format(Str2, sizeof(Str2), "{AFAFAF}Send a Message to {FF0000}%s", PlayerName(playerid)), strcat(Str3, Str2, sizeof(Str3)); //-------------------------------------------------------------------------- return ShowPlayerDialog(Receiver, DIALOG_PM, DIALOG_STYLE_INPUT, Str3, Str, "Send", "Close");iar aceasta este comanda:} CMD:pm(playerid,params[]) { new Str[129], Str2[128], Str3[129]; //-------------------------------------------------------------------------- if(sscanf(params, "u", PlayerInfo[playerid][PMID])) return SendUsage(playerid, "/PM [PlayerID]"); //-------------------------------------------------------------------------- if(IsPlayerConnected(PlayerInfo[playerid][PMID]) && PlayerInfo[playerid][PMID] != INVALID_PLAYER_ID) { //---------------------------------------------------------------------- if(PlayerInfo[playerid][PMID] == playerid) return SendError(playerid, "You cannot PM yourself!"); //---------------------------------------------------------------------- if(PlayerInfo[playerid][Muted] == 1) return Announce(playerid, "~w~~h~You are ~r~~h~muted~w~~h~!", 3000, 4), false; //---------------------------------------------------------------------- if(PlayerInfo[PlayerInfo[playerid][PMID]][Ignore_PM] == 1 && PlayerInfo[playerid][Level] <= 3) return SendError(playerid, "This player have /Ignore PM On!"); //---------------------------------------------------------------------- format(Str2, sizeof(Str2), "{00FF00}Hi, {FF0000}%s{00FF00}!\n", PlayerName(playerid)); strcat(Str, Str2, sizeof(Str)); format(Str2, sizeof(Str2), "{00FF00}Please type before the message you want to send to {00BBF6}%s{00FF00}!", PlayerName(PlayerInfo[playerid][PMID])); strcat(Str, Str2, sizeof(Str)); //------------------------------------------------------------------ format(Str2, sizeof(Str2), "{AFAFAF}Send a Private Message to {FF0000}%s", PlayerName(PlayerInfo[playerid][PMID])); strcat(Str3, Str2, sizeof(Str3)); //---------------------------------------------------------------------- return ShowPlayerDialog(playerid, DIALOG_PM, DIALOG_STYLE_INPUT, Str3, Str, "Send", "Close"); } else return SendError2(playerid, "Player not connected!", "Jucatorul nu este conectat!"); } omule... nu e atat de greu... trebuie doar sa inlocuiesti showplayerdialog cu sendclientmessage... @WiDuAlK Tutorial`s: PAWN pentru SA:MP in Notepad++Tutorial Register-Login MYSQL R39 Tutorial etape de register Cum sa creezi un PayDay (2 METODE)Cum sa creezi o factiune de la 0 PART 1 Cum sa creezi o factiune de la 0 PART 2 Cum sa creezi o factiune de la 0 partea a 3-a (ULTIMA)Functii folositoare din NEW.PWN Tutorial Engine Vehicle Optimizare simplitate si stil Foreach inlocuieste loop-ul SSCANF si ZCMD Cum sa creezi o poarta miscatoare Tutorial cum sa creezi un radio pe server si cum sa iti creezi melodi pentru ascultat pe server Cum sa tii un server din PC folosind HAMACHI Documentatie* Despre hack-uri Servicii: Servicii Scripting & Mapping Produse: Farmer Job Realistic Drugs Dealer System [SA-MP] UNIQUE Link to comment Share on other sites More sharing options...
lordhell12 Posted June 23, 2015 Author Report Share Posted June 23, 2015 omule... nu e atat de greu... trebuie doar sa inlocuiesti showplayerdialog cu sendclientmessage...return ShowPlayerDialog(playerid, DIALOG_PM, DIALOG_STYLE_INPUT, Str3, Str, "Send", "Close");Aici ce trebuie scris?Eu am scris SendClientMessage(playerid, text); si mi-a zis ca nu am definit text,cand il definesc imi pica pawno,adica numai raspunde programul. Link to comment Share on other sites More sharing options...
WiDuAlK Posted June 23, 2015 Report Share Posted June 23, 2015 SendClientMessage(playerid,culoarea,str); @WiDuAlK Tutorial`s: PAWN pentru SA:MP in Notepad++Tutorial Register-Login MYSQL R39 Tutorial etape de register Cum sa creezi un PayDay (2 METODE)Cum sa creezi o factiune de la 0 PART 1 Cum sa creezi o factiune de la 0 PART 2 Cum sa creezi o factiune de la 0 partea a 3-a (ULTIMA)Functii folositoare din NEW.PWN Tutorial Engine Vehicle Optimizare simplitate si stil Foreach inlocuieste loop-ul SSCANF si ZCMD Cum sa creezi o poarta miscatoare Tutorial cum sa creezi un radio pe server si cum sa iti creezi melodi pentru ascultat pe server Cum sa tii un server din PC folosind HAMACHI Documentatie* Despre hack-uri Servicii: Servicii Scripting & Mapping Produse: Farmer Job Realistic Drugs Dealer System [SA-MP] UNIQUE Link to comment Share on other sites More sharing options...
lordhell12 Posted June 24, 2015 Author Report Share Posted June 24, 2015 (edited) SendClientMessage(playerid,culoarea,str);Acum imi apare mesajul acesta in joc,iar jucatorul nu imi primeste mesajul pe care eu il trimit:format(Str2, sizeof(Str2), "{00FF00}Hi, {FF0000}%s{00FF00}!\n", PlayerName(playerid)); strcat(Str, Str2, sizeof(Str)); format(Str2, sizeof(Str2), "{00FF00}Please type before the message you want to send to {00BBF6}%s{00FF00}!", PlayerName(PlayerInfo[playerid][PMID])); strcat(Str, Str2, sizeof(Str)); Edited June 24, 2015 by lordhell12 Link to comment Share on other sites More sharing options...
Recommended Posts