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

Release [WIP][TF2] Cash For Kills (Progress-Tracking Thread!)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
404UserNotFound
BANNED
Join Date: Dec 2011
Old 03-05-2013 , 13:52   [WIP][TF2] Cash For Kills (Progress-Tracking Thread!)
Reply With Quote #1

So I'm working on this again! See the latest post for more info!

Last edited by 404UserNotFound; 11-28-2013 at 12:23.
404UserNotFound is offline
Arrow768
Veteran Member
Join Date: Nov 2011
Location: Austria
Old 03-05-2013 , 14:07   Re: [TF2] X amount of credits per kill/point cap/intel cap/etc?
Reply With Quote #2

The Basic Store-System should be as basic as possible to be able to use store with as many mods (cs:s,tf2,...) as possible.

For your specific needs a TF2 Store Module would be the correct way. You should post a summary of your request in this thread if you cant make it yourself.

Why do you need SQL Functions, wouldnt it be easier to use the store native to give credits to a client ?

Code:
/**
 * Gives multiple players a specific amount of credits. 
 * 
 * You can also set the credits parameter to a negative value to take credits
 * from the players.
 *
 * As with all other store-backend methods, this method is completely asynchronous.
 *
 * @param accountIds	    The account IDs of the players, use Store_GetClientAccountID to convert a client index to account ID.
 * @param accountIdsLength  Players count.
 * @param credits           The amount of credits to give to the players.
 *
 * @noreturn
 */
native Store_GiveCreditsToUsers(accountIds[], accountIdsLength, credits);
EDIT: Just saw you posted in the request module thread.
I have found the native there
__________________

Last edited by Arrow768; 03-05-2013 at 14:10.
Arrow768 is offline
Arrow768
Veteran Member
Join Date: Nov 2011
Location: Austria
Old 03-05-2013 , 14:25   Re: [TF2] X amount of credits per kill/point cap/intel cap/etc?
Reply With Quote #3

You can get the account id with
Code:
Store_GetClientAccountID(client)
If you have a working store plugin, it should handle all the connections to the db when using natives (if you have included the correct store includes)
__________________

Last edited by Arrow768; 03-05-2013 at 14:26.
Arrow768 is offline
alongub
Veteran Member
Join Date: Aug 2009
Location: Israel
Old 03-05-2013 , 18:41   Re: [TF2] X amount of credits per kill/point cap/intel cap/etc?
Reply With Quote #4

Take a look at store-distributor.sp to see an example of how to give credits to a player using the Store_GiveCredits native.
__________________
alongub is offline
alongub
Veteran Member
Join Date: Aug 2009
Location: Israel
Old 03-10-2013 , 10:31   Re: [TF2] X amount of credits per kill/point cap/intel cap/etc?
Reply With Quote #5

Should be as simple as

Code:
public Action:Event_PlayerStealSandvich(Handle:event, const String:name[], bool:dontBroadcast)
{
    new client = GetClientOfUserId(GetEventInt(event, "target"));

    if (!IsClientInGame(client))
        return Plugin_Continue;

    if (IsFakeClient(cilent))
        return Plugin_Continue;

    new credits = GetConVarInt(Credits_StealSandvich);

    PrintToChat(client, "\x05[STORE]\x01 You got $%i for stealing a Sandvich", credits);
    Store_GiveCredits(Store_GetClientAccountID(client), credits);
}
__________________
alongub is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 03-12-2013 , 15:40   Re: [WIP][TF2] Cash For Kills (Progress-Tracking Thread!)
Reply With Quote #6

I've repurposed this thread into a progress-tracking thread, now that I've got a pretty good idea of what I'm doing!
404UserNotFound is offline
vodka00
Veteran Member
Join Date: Jun 2012
Location: Los Angeles
Old 03-12-2013 , 20:16   Re: [WIP][TF2] Cash For Kills (Progress-Tracking Thread!)
Reply With Quote #7

Woow this is nice man
__________________
cw main:

cw speedruns:
vodka00 is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 03-12-2013 , 20:18   Re: [WIP][TF2] Cash For Kills (Progress-Tracking Thread!)
Reply With Quote #8

Quote:
Originally Posted by vodka00 View Post
Woow this is nice man
Awwww shucks. Thanks!
404UserNotFound is offline
alongub
Veteran Member
Join Date: Aug 2009
Location: Israel
Old 03-12-2013 , 21:50   Re: [WIP][TF2] Cash For Kills (Progress-Tracking Thread!)
Reply With Quote #9

Awesome.
__________________
alongub is offline
Arrow768
Veteran Member
Join Date: Nov 2011
Location: Austria
Old 03-13-2013 , 02:39   Re: [WIP][TF2] Cash For Kills (Progress-Tracking Thread!)
Reply With Quote #10

Looks very interesting.
Btw. you forgot the ending slash at the
Quote:
Originally Posted by abrandnewday View Post
[U]Weapon-Specific Kills[U]
What do you think about storing the settings in the database, so they could be changed via a Webinterface (maybe the WebPanel) ?
__________________

Last edited by Arrow768; 03-13-2013 at 02:50.
Arrow768 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 03:18.


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