PDA

View Full Version : [CSS] Money is not reduced.


jungjunghoo
01-08-2012, 04:07
Here is part of my source


public He_menu(Handle:Menu, MenuAction:Click, Parameter1, Parameter2)
{
new Handle:Panel = CreatePanel();
new Client = Parameter1;
new Money = GetEntProp(Client, Prop_Send, "m_iAccount")

if(Click == MenuAction_Select)
{
if(GetClientTeam(Client) == CS_TEAM_CT)
{
if(IsPlayerAlive(Client))
{
if(Parameter2 == 1)
{
if(Money >= 3000)
{
Money -= 3000;
GiveClientGrenade(Client, 1);
He(Client);
}
}

if(Parameter2 == 2)
{
if(Money >= 2000)
{
Money -= 2000;
GivePlayerItem(Client, "weapon_flashbang");
He(Client);
}
}

if(Parameter2 == 0)
{
Main_Shop(Client);
}
}
else
{
}
}
else
{
}
}
CloseHandle(Panel);
}


It give granade If I use this menu but Money is still there.
What's problem?
Help me

Thank you

Impact123
01-08-2012, 04:51
You use GetEntProp to get the money from a player and save it into an variable.
Later on you just change the variable, to change the actual money you must do the same as before just with SetEntProp.
I hope you understand.


Yours sincerely
Impact

tjdgns9246
01-08-2012, 07:45
Here is part of my source


public He_menu(Handle:Menu, MenuAction:Click, Parameter1, Parameter2)
{
new Handle:Panel = CreatePanel();
new Client = Parameter1;
new Money = GetEntProp(Client, Prop_Send, "m_iAccount")

if(Click == MenuAction_Select)
{
if(GetClientTeam(Client) == CS_TEAM_CT)
{
if(IsPlayerAlive(Client))
{
if(Parameter2 == 1)
{
if(Money >= 3000)
{
Money -= 3000;
GiveClientGrenade(Client, 1);
He(Client);
}
}

if(Parameter2 == 2)
{
if(Money >= 2000)
{
Money -= 2000;
GivePlayerItem(Client, "weapon_flashbang");
He(Client);
}
}

if(Parameter2 == 0)
{
Main_Shop(Client);
}
}
else
{
}
}
else
{
}
}
CloseHandle(Panel);
}


It give granade If I use this menu but Money is still there.
What's problem?
Help me

Thank you

네 소나기님 안녕하세요 ^^;
Yeh, hi sonagi ^^;

바로 지적하자면
To point out,



new Money = GetEntProp(Client, Prop_Send, "m_iAccount");


여기서 Money변수의 값을 가져왔습니다.
Here you brought the value of 'Money'

그런데 그 변수에
btw, you did


Money -= 2000;


를 해주셨군요, 이러면 Money변수의 값만 바뀌지, 클라이언트의 m_iAccount의 값은 바뀌지 않아요.
like this, then it doesn't change 'm_iAccount' but value of 'Money'.

그래서
so

SetEntProp으로 m_iAccount의 값을 수류탄의 가격을 빼준 Money변수로 지정해주시면 됩니다.
you can set 'm_iAccount' 'Money' which subtracted price of grenades by SetEntProp

jungjunghoo
01-08-2012, 08:45
제가 소스모드는 무뇌한이라 소스를 다른분께서 짜주신건데 API사이트가서 찾아봐도 통 이해할수가없네요.
만들어주신분도 뭐가잘못된건지모르겠다고하셔서 여기로들고온건데...
어떻게 수정하면 될까요.

tjdgns9246
01-08-2012, 09:06
제가 소스모드는 무뇌한이라 소스를 다른분께서 짜주신건데 API사이트가서 찾아봐도 통 이해할수가없네요.
만들어주신분도 뭐가잘못된건지모르겠다고하셔서 여기로들고온건데...
어떻게 수정하면 될까요.


public He_menu(Handle:Menu, MenuAction:Click, Parameter1, Parameter2)
{
new Handle:Panel = CreatePanel();
new Client = Parameter1;
new Money = GetEntProp(Client, Prop_Send, "m_iAccount")

if(Click == MenuAction_Select)
{
if(GetClientTeam(Client) == CS_TEAM_CT)
{
if(IsPlayerAlive(Client))
{
if(Parameter2 == 1)
{
if(Money >= 3000)
{
Money -= 3000;
SetEntProp(Client, Prop_Send, "m_iAccount", Money);
GiveClientGrenade(Client, 1);
He(Client);
}
}

if(Parameter2 == 2)
{
if(Money >= 2000)
{
Money -= 2000;
SetEntProp(Client, Prop_Send, "m_iAccount", Money);
GivePlayerItem(Client, "weapon_flashbang");
He(Client);
}
}

if(Parameter2 == 0)
{
Main_Shop(Client);
}
}
else
{
}
}
else
{
}
}
CloseHandle(Panel);
}


요렇게 해주세욤 ^^
do it like this ^^

asherkin
01-08-2012, 11:19
This is an English language only forum, include a English translation of your message in your post if you really feel the need to post in a foreign language.

tjdgns9246
01-09-2012, 04:13
This is an English language only forum, include a English translation of your message in your post if you really feel the need to post in a foreign language.

ok, i'm sorry asherkin

i'm going to edit it.

sorry

jungjunghoo
01-09-2012, 05:59
감사합니다.
몇가지더질문드리고싶은데요.

est_fade라는 구문과 emitsound 라는 게 소스모드에서 어떻게 쓰는지 궁금하네요.
살때마다 두 효과를 주려고하는데...

(fade =

es est_fade event_var(userid) 0 1 1 0 0 255 100

http://222.106.144.36/web/demo/screenshots/ze_ffvii_mako_reactor_v3_10005.jpg )

(emitsound -
es_emitsound player event_var(userid) items\smallmedkit1.wav 1.0 0.5 )


Thank you.
I have few question more
I want to add effect when player using shop.
I need example about est_fade and emitsound like this
Eventscripts is informational purposes only


(fade =

es est_fade event_var(userid) 0 1 1 0 0 255 100

http://222.106.144.36/web/demo/screenshots/ze_ffvii_mako_reactor_v3_10005.jpg )

(emitsound -
es_emitsound player event_var(userid) items\smallmedkit1.wav 1.0 0.5 )