Raised This Month: $51 Target: $400
 12% 

I don't know this problem !! Help me Plz!!...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
daehee20
Junior Member
Join Date: Feb 2010
Old 05-06-2010 , 00:09   I don't know this problem !! Help me Plz!!...
Reply With Quote #1

Quote:



#include <sourcemod>
#include <sdktools>

public OnPluginStart()
{
}
public OnGameFrame()
{
for(new Client = 0; Client >= MaxClients; Client++)
{
if(AliveCheck(Client))
{
new Player = GetClientAimTarget(Client, true);
if(GetClientButtons(Client) & IN_USE)
{
Command_Information(Client, Player);
}
}
}
}
public Command_Information(Client, Player)
{
new Handle:info = CreateMenu(Menu_Information);
new String:SteamID[32], String:CIP[32], String:CName[32];
GetClientName(Player, CName, 32);
GetClientAuthString(Player, SteamID, 32);
GetClientIP(Player, CIP, 32);
new String:FCname[256], String:FCIP[256], String:FID[256];
Format(FCname, 256, "Legend Bhop [이름] : %s", CName);
Format(FCIP, 256, "Legend Bhop [아이피] : %s", CIP);
Format(FID, 256, "Legend Bhop [고유번호] : %s", SteamID);
SetMenuTitle(info, "Client Information");
AddMenuItem(info, "이름", FCname);
AddMenuItem(info, "아이피", FCIP);
AddMenuItem(info, "고유번호", FID);
SetMenuExitButton(info, true);

DisplayMenu(info, Client, MENU_TIME_FOREVER);
}

public Menu_Information(Handle:menu, MenuAction:action, Client, select)
{
if(action == MenuAction_Select)
{
if(select == 0)
{
PrintToChat(Client, "\x04 Created By AKB, HIS");
}else if(select == 1)
{
PrintToChat(Client, "\x04 Created By AKB, HIS");
}else if(select == 2)
{
PrintToChat(Client, "\x04 Created By AKB, HIS");
}else if(select == 3)
{
PrintToChat(Client, "\x04 Created By AKB, HIS");
}else if(action == MenuAction_Cancel)
{
if(select == MenuCancel_Exit)
{

PrintToChat(Client, "\x04 정보보기를 종료.");

}
}else if(action == MenuAction_End)
{

CloseHandle(menu);

}
}
}

public bool:AliveCheck(Client)
{
if(Client > 0 && Client <= MaxClients)
{
if(IsClientConnected(Client) == true)
{
if(IsClientInGame(Client) == true)
{
if(IsPlayerAlive(Client) == true)
{
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
else
{
return false;
}
}
else
{
return false;
}
}
-------------------------------------------------------

Why not open menu?,,,,

Help me Plz
daehee20 is offline
rcarm
Member
Join Date: Feb 2010
Old 05-06-2010 , 00:43   Re: I don't know this problem !! Help me Plz!!...
Reply With Quote #2

Use OnPlayerRunCmd instead of OnGameFrame

http://docs.sourcemod.net/api/index....d=show&id=937&
rcarm is offline
dirka_dirka
Veteran Member
Join Date: Nov 2009
Old 05-06-2010 , 00:57   Re: I don't know this problem !! Help me Plz!!...
Reply With Quote #3

my god wheres your indentation

your first for loop is wrong. it should be < not > . it should also start with 1, client 0 will be invalid.

also, instead of nesting all those if statements at the bottom, just reverse it (!) and if true return.
dirka_dirka is offline
daehee20
Junior Member
Join Date: Feb 2010
Old 05-06-2010 , 09:39   Re: I don't know this problem !! Help me Plz!!...
Reply With Quote #4

i can't understand

can you give me example?
daehee20 is offline
HL-SDK
Member
Join Date: Jan 2009
Old 05-06-2010 , 10:45   Re: I don't know this problem !! Help me Plz!!...
Reply With Quote #5

PHP Code:
if(Client && Client <= MaxClients)
{
    if(
IsClientConnected(Client) && IsClientInGame(Client) && IsPlayerAlive(Client))
    {
        return 
true;
    }
}
return 
false


---
EDIT

Changed ORs to ANDs
HL-SDK is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:05.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode