Some F9 Help

Results 1 to 4 of 4
  1. #1
    Doggie And Rice. Military is offline
    MemberRank
    Jun 2009 Join Date
    Here and AboutLocation
    3,302Posts

    Some F9 Help

    I wanted to make F9 HP/AP a way that when you die a message is displayed other than (HP:0 , AP:0) and it's not working out so well . Here's the code ..

    Code:
    case VK_F9:
    					{
    			char szMsg[256] = "";
    			if(ZGetGame()->m_pMyCharacter->IsDie() == 1 && (ZGetGame()->GetMatch()->IsTeamPlay() == 1))
    			{
    
    					sprintf(szMsg, "!I'm Dead.");
    			} else {
    					sprintf(szMsg, "I'm Respawning.");
    			}
    			
    			if(ZGetGame()->GetMatch()->IsTeamPlay()) {
    
    					sprintf(szMsg, "!(HP: %d , AP: %d)" , (int)ZGetGame()->m_pMyCharacter->GetHP() , (int)ZGetGame()->m_pMyCharacter->GetAP());
    					ZApplication::GetGameInterface()->GetChat()->Input(szMsg);
    					return true;
    			} else {
    					sprintf(szMsg, "(HP: %d , AP: %d)" , (int)ZGetGame()->m_pMyCharacter->GetHP() , (int)ZGetGame()->m_pMyCharacter->GetAP());
    					ZApplication::GetGameInterface()->GetChat()->Input(szMsg);
    					return true;
    			}
    					}
    					break;


  2. #2
    Daemonsring Developer Gunblade is offline
    MemberRank
    Jul 2007 Join Date
    On the moonLocation
    728Posts

    Re: Some F9 Help

    maybe something like: if((int)ZGetGame()->m_pMyCharacter->GetHP() <= 0) { sprintf(szMsg, "!I'm Dead."); return true; }

  3. #3
    Hi, I'm Omar! Vusion is offline
    MemberRank
    Jan 2011 Join Date
    HereLocation
    1,658Posts

    Re: Some F9 Help

    Code:
    case VK_F9:
    {
    	char szMsg[256] = "";
    	
    	if(ZGetGame()->m_pMyCharacter->IsDie())
    		sprintf(szMsg, "I'm dead.");
    	else
    		sprintf(szMsg, "(HP: %d , AP: %d)", (int)ZGetGame()->m_pMyCharacter->GetHP() , (int)ZGetGame()->m_pMyCharacter->GetAP());
    		
    	if(ZGetGame()->m_pMyCharacter->IsTeamPlay())
    		ZPostPeerChat(szMsg, ZGetGame()->m_pMyCharacter->GetTeamID());
    	else
    		ZPostPeerChat(szMsg);
    }
    break;
    But then again I tell, a message like I'm dead should only be outputted locally for the client only and not in the chat; and of course, MAIET did it all for us, and the function name would be ZChatOutput().

  4. #4
    Account Upgraded | Title Enabled! medotarek is offline
    MemberRank
    Apr 2012 Join Date
    Egypt/RageZoneLocation
    615Posts

    Re: Some F9 Help

    Good Job



Advertisement