[Help] Add a command to the premium.

Results 1 to 2 of 2
  1. #1
    Account Upgraded | Title Enabled! Oosmar02 is offline
    MemberRank
    Sep 2013 Join Date
    FranceLocation
    894Posts

    [Help] Add a command to the premium.

    Hello, I found and add a command but there to hang eror compilation, here is my code:


    Code:
    void HUDDisplay::eventChatMessage(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount){
    	chatInputActive = false;
    	lastChatMessageSent = r3dGetTime();
    
    
    	static char s_chatMsg[2048];
    	int currentTabIndex = args[0].GetInt();
    	r3dscpy(s_chatMsg, args[1].GetString());
    
    
    	bool has_anything = false;
    
    
    	size_t start_text=0;
    	size_t argLen = strlen(s_chatMsg);
    	if(argLen < 3)
    		return;
    
    
    	if (gUserProfile.ProfileData.isPremium)
    	{
    		if(strncmp(s_chatMsg, "/stime", 5) == NULL)
    		{
    			char buf[256];
    			int hour, min;
    			if(3 != sscanf(s_chatMsg, "%s %d %d", buf, &hour, &min))
    			{
    				addChatMessage(0, "<SYSTEM>", "/stime {hour} {min}", 0);
    				return;
    			}
    
    
    
    
    
    
    			__int64 gameUtcTime = gClientLogic().GetServerGameTime();
    			struct tm* tm = _gmtime64(&gameUtcTime);
    			r3d_assert(tm);
    
    
    			// adjust server time to match supplied hour
    			gClientLogic().gameStartUtcTime_ -= tm->tm_sec;
    			gClientLogic().gameStartUtcTime_ -= (tm->tm_min) * 60;
    			gClientLogic().gameStartUtcTime_ += (hour - tm->tm_hour) * 60 * 60;
    			gClientLogic().gameStartUtcTime_ += (min) * 60;
    			gClientLogic().lastShadowCacheReset_ = -1;
    
    
    			addChatMessage(0, "<SYSTEM>", "time changed, 0);
    			return;
    		}
    	}
    	if (gUserProfile.ProfileData.isDevAccount)
    	{
    		if(strncmp(s_chatMsg, "/nodrop", 5) == NULL)
    		{
    			if (IsNoDrop)
    			{
    				IsNoDrop = false;
    				addChatMessage(0, "<SYSTEM>", "No Drop Disabled", 0);
    				return;
    			}
    
    
    			IsNoDrop = true;
    			addChatMessage(0, "<SYSTEM>", "No Drop Enabled", 0);
    			return;
    
    
    		}
    		if(strncmp(s_chatMsg, "/safe", 5) == NULL)
    		{
    			obj_Player* plr = gClientLogic().localPlayer_;
    			r3d_assert(plr);
    			obj_SafeLock* obj = (obj_SafeLock*)srv_CreateGameObject("obj_SafeLock", "obj_SafeLock", plr->GetPosition());
    			obj->SetNetworkID(100001);
    			obj->OnCreate();
    		}
    		if(strncmp(s_chatMsg, "/spawngrave", 6) == NULL)
    		{
    			obj_Player* plr = gClientLogic().localPlayer_;
    			r3d_assert(plr);
    			obj_Grave* obj = (obj_Grave*)srv_CreateGameObject("obj_Grave", "obj_Grave", plr->GetPosition());
    			obj->SetNetworkID(10000);
    			obj->OnCreate();
    		}
    		if(strncmp(s_chatMsg, "/stime", 5) == NULL)
    		{
    			char buf[256];
    			int hour, min;
    			if(3 != sscanf(s_chatMsg, "%s %d %d", buf, &hour, &min))
    			{
    				addChatMessage(0, "<SYSTEM>", "/stime {hour} {min}", 0);
    				return;
    			}
    
    
    
    
    
    
    			__int64 gameUtcTime = gClientLogic().GetServerGameTime();
    			struct tm* tm = _gmtime64(&gameUtcTime);
    			r3d_assert(tm);
    
    
    			// adjust server time to match supplied hour
    			gClientLogic().gameStartUtcTime_ -= tm->tm_sec;
    			gClientLogic().gameStartUtcTime_ -= (tm->tm_min) * 60;
    			gClientLogic().gameStartUtcTime_ += (hour - tm->tm_hour) * 60 * 60;
    			gClientLogic().gameStartUtcTime_ += (min) * 60;
    			gClientLogic().lastShadowCacheReset_ = -1;
    
    
    			addChatMessage(0, "<SYSTEM>", "time changed", 0);
    			return;
    		}
    	}
    	if(strncmp(s_chatMsg, "/invite", 6) == NULL)
    	{
    		char buf[256];
    		char name[256];
    		if(2 != sscanf(s_chatMsg, "%s %s", buf, &name))
    		{
    			addChatMessage(0, "<SYSTEM>", "/invite {name}", 0);
    			return;
    		}
    		obj_Player* plr = gClientLogic().localPlayer_;
    		PKT_S2C_SendGroupInvite_s n;
    		n.FromCustomerID = plr->CustomerID;
    		sprintf(n.intogamertag,name);
    		//n.FromID = 9999999999;
    		r3dscpy(n.fromgamertag,plr->CurLoadout.Gamertag);
    		p2pSendToHost(plr, &n, sizeof(n));
    	}
    
    
    	char userName[64];
    	gClientLogic().localPlayer_->GetUserName(userName);
    
    
    	{
    		PKT_C2C_ChatMessage_s n;
    		n.userFlag = 0; // server will init it for others
    		n.msgChannel = currentTabIndex;
    		r3dscpy(n.msg, &s_chatMsg[start_text]);
    		r3dscpy(n.gamertag, userName);
    		p2pSendToHost(gClientLogic().localPlayer_, &n, sizeof(n));
    	}
    
    
    	uint32_t flags = 0;
    
    
    	if(gUserProfile.ProfileData.AccountType==0)
    	{
            flags|=2;
        }
        if(gUserProfile.ProfileData.isDevAccount)
        {
            flags|=3;
        }
        if(gUserProfile.ProfileData.isPunisher)
        {
            flags|=4;
        }
    	if (gUserProfile.ProfileData.isPremium)
    	{
            flags|=5;
        }
    
    
    	addChatMessage(currentTabIndex, userName, &s_chatMsg[start_text], flags);
    
    
    	memset(s_chatMsg, 0, sizeof(s_chatMsg));
    }
    Error :
    thanks for help.


  2. #2
    Custom Title Enabled GigaToni is offline
    MemberRank
    Aug 2009 Join Date
    GER / FRLocation
    2,329Posts

    Re: [Help] Add a command to the premium.

    addChatMessage(0, "<SYSTEM>", "time changed, 0);
    you're missing a "



Advertisement