Forum

> > CS2D > Scripts > PM Lua
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch PM Lua

29 Antworten
Seite
Zum Anfang Vorherige 1 2 Nächste Zum Anfang

alt Re: PM Lua

mr_s
User Off Offline

Zitieren
user Suprise hat geschrieben
samer hat geschrieben
months will be deleted?


yes, no more payday.



REPLY: IF smiley city lua have pm system? if no update it and add because all my trys to add pm system got lose
EDIT: if yes tell me the command
---------------------------------
sorry for my bad english
1× editiert, zuletzt 05.03.13 15:28:11

alt Re: PM Lua

Shawni
User Off Offline

Zitieren
@user mr_s: After wasting sometimes reading this fuckbrain lua, am happy to tell you that there isn't a PM system on it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function pm(id,t)
     if (t:sub(1,6)=="@sayto") then
          local tt={}
         for w in t:gmatch("[^%s]+") do tt[#tt+1]=w end
          local pl=tt[2]
          local m=table.concat(tt," ",3)
          if (player(pl,"exists")) then
               msg2(id,"PM to "..player(pl,"name")..": "..m)
               msg2(pl,"PM from "..player(id,"name")..": "..m)
          else
               msg2(id,"Player with the ID "..pl.." does not exist!")
          end
          return 1
     end
end
Add this randomly on the script.
and change your say hook with :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
addhook("say","rp_int")
function rp_int(id,txt)
	
	if Mute_text== 1 then
		rp_msg2(id,"255000000","You cant send message in mute mode, use team message")
		return 1
	end
	
	-- if depos[id] == 0 and checkbound(id,Config.Bank) then
		-- local bankamount = txt
		-- if rp_money[id] >= bankamount then
			-- rp_money[id] = rp_money[id] - bankamount
			-- Bankmoney[id] = Bankmoney[id] + bankamount
			-- updatehud(id)
			-- depos[id] = 0
		-- elseif rp_money[id] < bankamount then
			-- rp_msg2(id,"255255255","not enought money with you")
			-- depos[id] = 0
		-- end
	-- end
	
	--if withd[id] == 1 and checkbound(id,Config.Bank) then
		-- local bankamount = txt
		-- if Bankmoney[id] >= bankamount then
			-- rp_money[id] = rp_money[id] + bankamount
			-- Bankmoney[id] = Ban\kmoney[id] - bankamount
			-- updatehud(id)
			-- rp_msg2(id,"255255255","You have successfuly withdrawn "..bankamount.."$ from your Bank-account!")
			-- withd[id] = 0
		-- elseif Bankmoney[id] < bankamount then
			-- rp_msg2(id,"255255255","not enought money on your Bank-account!")
			-- withd[id] = 0
		-- end
	--end	
	--withd[id] = 0
	
	 if (txt =="hi" and player(id,"tilex")==vehiclenpcx and player(id,"tiley")==vehiclenpcy) then
	 rp_msg2(id,"255000000","Vehicle Seller: Hello Which vehicle you would like to rent?")
	menu(id,"Vehicle list 1,BMW 2010 |3k,Porche |1.5k,Nissan |5k,BMW X5 |7.5k,Sedan |3k,Other Vehicles")
     elseif (txt=="hi" and player(id,"tilex")==horsenpcx and player(id,"tiley")==horsenpcy) then
	 rp_msg2(id,"255000000","Horse Seller: Hello Which horse you would like to rent?")
	menu(id,"Horses,White horse |10k,Orange horse |10k,Brown horse |10k")
    elseif (txt=="hi" and player(id,"tilex")==movienpcx and player(id,"tiley")==movienpcy) then
	 rp_msg2(id,"255000000"," Hello Which movie you would like to watch?")
	menu(id,"Movie,Naruto |100$,Harry Potter |100$,bye")    
     elseif (txt=="hi" and player(id,"tilex")==bridge1npcx and player(id,"tiley")==bridge1npcy) then
	 rp_msg2(id,"255000000","Hi,Welcome to the island.")
	menu(id,"Bridge,Can I pass?,Buy a ticket. |30k,Bye")
	elseif (txt=="hi" and player(id,"tilex")==bridge2npcx and player(id,"tiley")==bridge2npcy) then
	 rp_msg2(id,"255000000","Hi,Welcome to the island.")
	menu(id,"Bridge2,Can I pass?,Buy a ticket. |30k,Bye")
	elseif (txt=="hi" and player(id,"tilex")==vicarnpcx and player(id,"tiley")==vicarnpcy) then
	 rp_msg2(id,"255000000","Vicar:Welcome to the church.")
	 menu(id,"Heal,Heal |1k,Bye")
	elseif (txt=="hi" and player(id,"tilex")==licensenpcx and player(id,"tiley")==licensenpcy) then
	 rp_msg2(id,"255000000","License Seller: Hello Which License you would like to Buy?")
	menu(id,"License List,Normal License |100k,Vehicle License |150k,Vip |5000k,Temp Ct power |100000k,Buy speed")    
   elseif (txt=="hi" and player(id,"tilex")==shopnpcx and player(id,"tiley")==shopnpcy) then
		if rp_Adminlevel[id] >= 1 then
		rp_msg2(id,"255000000","House Seller: Hello admin, What would you like to do?")
		menu(id,"sansnasa,This menu , is under, constuction!")
		else 
		rp_msg2(id,"255000000","House Seller: Hello, Which house you would like to Buy?")
		menu(id,"Buy House,house 1 |"..house1owner..",house 2 |"..house2owner..",house 3 |"..house3owner..",house 4 |"..house4owner..",house 5 |"..house5owner..",bye")
		end
	elseif (txt=="hi" and player(id,"tilex")==shop2npcx and player(id,"tiley")==shop2npcy) then
		if rp_Adminlevel[id] >= 1 then
		rp_msg2(id,"255000000","House Seller: Hello admin, What would you like to do?")
		menu(id,"sansnasa2,This menu , is under, constuction!")
		else 
		rp_msg2(id,"255000000","House Seller: Hello, Which house you would like to Buy?")
		menu(id,"Buy House2,house 6 |"..house6owner..",house 7 |"..house7owner..",house 8 |"..house8owner..",house 9 |"..house9owner..",house 10 |"..house10owner..",bye")
		end
    elseif (txt=="hi" and player(id,"tilex")==magicnpcx and player(id,"tiley")==magicnpcy) then
	 rp_msg2(id,"255000000","Magician: Hello Which Magic you would like to learn?")
	CreateAddonsSell(id)
	elseif (txt=="hi" and checkbound(id,Config.Bank)) then
	 rp_msg2(id,"255000000","Banker:Welcome to the bank.")
	 menu(id,"bank,my money  |"..Bankmoney[id]..",Deposit ,Withdraw,Credit card ,Info ")
	end
	
	if rp_ct[id]==true then
		if txt:sub(1,1)=="!" then
			print(player(id,'name')..' used a command:'..txt)
			ParseAdminCommand(id,txt)
			return 1
		end
		if txt:sub(1,1)=="@" then
			print(player(id,'name')..' sent a message:'..txt)
                        pm(id,txt)
			return 1
                end
		if txt:sub(1,1)=="$" then
			print(player(id,'name')..' made a action:'..txt)
			more_say(id,txt)
			return 1
		end
	
	if rp_ct[id] == true then
		if txt ~="rank" then
			if rp_Adminlevel[id] == 8 then
				rp_msg("255000000",player(id,"name").."(Owner): "..txt)
			elseif rp_Adminlevel[id]== 7 then
				rp_msg("255255255",player(id,"name").."(Citizen): "..txt)
			elseif rp_Adminlevel[id]== 6 then
			    rp_msg("233114250",player(id,"name").."(Clan leader): "..txt)	
			elseif rp_Adminlevel[id]== 5 then
			    rp_msg("124255062",player(id,"name").."(Admin Level 5): "..txt)
			elseif rp_Adminlevel[id]== 4 then
			    rp_msg("062255245",player(id,"name").."(Admin Level 4): "..txt)	
			elseif rp_Adminlevel[id]== 3 then
			    rp_msg("071062255",player(id,"name").."(Admin Level 3): "..txt)
			elseif rp_Adminlevel[id] == 2 then
			    rp_msg("250255062",player(id,"name").."(Admin Level 2): "..txt)
			elseif rp_Adminlevel[id] == 1 then
			    rp_msg("254154063",player(id,"name").."(Admin Level 1): "..txt)	
			else
				rp_msg("192192192",player(id,"name").."(Scripter): "..txt)
			end
		return 1
		end
	end
	end
	
	if rp_vipmsg[id]>0 and txt ~="rank" then
		rp_msg("000255255",player(id,"name").."(VIP): "..txt)
		rp_vipmsg[id]=0
		return 1
	end
	
	if rp_ct[id] == false then
	   if txt ~="rank" then
			if rp_Adminlevel[id] == 0 then
				rp_msg("255255255",player(id,"name").."(Citizen): "..txt)
			return 1
			end
		end
	end
end

alt Re: PM Lua

mr_s
User Off Offline

Zitieren
you from reading my fucking lua?
ok i will try
¼
REPLY: and still dont work

alt Re: PM Lua

Xirot
User Off Offline

Zitieren
@user mr_s: Have a look on the console , what does it say ( the error )

alt Re: PM Lua

mr_s
User Off Offline

Zitieren
i don't say that the error is my problem, i will fix it, but how to send a pm without showing to all?


this is my question

alt Re: PM Lua

Rainoth
Moderator Off Offline

Zitieren
that would be to use "return 1" on your say hook provided that it's the only say hook you made (if you made more it get's more complicated)

alt Re: PM Lua

mr_s
User Off Offline

Zitieren
i am now no more admin in my server

alt Re: PM Lua

Dousea
User Off Offline

Zitieren
This script should be work.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
addhook("say","_pm")
function _pm(id,txt)
	if string.sub(txt, 1, 6) == "@sayto" then
		if string.sub(txt, 7, 8) ~= nil then
			local clr = string.char(169)
			if string.sub(txt, 9, 9) ~= " " then
				pl = tonumber(string.sub(txt, 8, 9))
				text = string.sub(txt, 11, #txt)
			else
				pl = tonumber(string.sub(txt, 8, 8))
				text = string.sub(txt, 10, #txt)
			end
			if player(pl,"exists") then
				msg2(id,"Private Message has been sent!@C")
				if player(id,"team") == 1 then msg2(pl,clr.."255000000"..player(id,"name").." "..clr.."255220000(PM): "..text); end
				if player(id,"team") == 2 then msg2(pl,clr.."000000255"..player(id,"name").." "..clr.."255220000(PM): "..text); end
			else
				msg2(id,clr.."255000000Player with ID "..pl.." doesn't exist!@C")
			end
			return 1
		end
	end
	return 1
end

alt this dude did not ask the creator for premission!

payback132
User Off Offline

Zitieren
and u said u made the lua i feather like u did atleast say edited by samer creator of lua is smiley instead of creator is samer


also the map put it -map edited by baby sitter creator of map smiley-


or do u want to get reported?
Zum Anfang Vorherige 1 2 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht