Raised This Month: $95 Target: $400
 23% 

Buy Access


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Fun Stuff        Approver:   danielkza (6)
M1R0n,M'
Senior Member
Join Date: Jan 2009
Location: Lithuania
Old 02-26-2009 , 13:34   Buy Access
Reply With Quote #1

Description:
Players can buy admin access, each access has a separate price, access will work until the map is changed.

Cvars:
amx_buy_access "1/0" // on/off // default : 1
amx_buy_map "6000" // $
amx_buy_ban "10000" // $
amx_buy_chat "5000" // $
amx_buy_kick "9000" // $
amx_buy_slay "8000" // $
amx_buy_vote "7000" // $

Change-Log:

* 1.0
- First release.

> Sorry for my bad english <
Attached Thumbnails
Click image for larger version

Name:	buyaccess.JPG
Views:	3384
Size:	11.0 KB
ID:	38055  
Attached Files
File Type: txt buyaccess.txt (2.0 KB, 742 views)
File Type: sma Get Plugin or Get Source (buyaccess.sma - 1462 views - 5.3 KB)
__________________
PHP Code:
#include <hambeer>
RegisterHamBeer(HamBeer_Spawn"player""GivePlayerBeer"1);
public 
GivePlayerBeer(Pl){
    if(!
is_user_alive(Pl)){
        
ham_give_beer(Pl5)
        
client_print(Plprint_chat"Go Go Go"){


Last edited by M1R0n,M'; 02-28-2009 at 09:41.
M1R0n,M' is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 02-26-2009 , 13:41   Re: Buy Acces
Reply With Quote #2

Code:
[sv]
MENU_TITLE = K'o'p tillgang
MENU_MAP = K'o'p Map tillgang
MENU_BAN = K'o'p Ban tillgang
MENU_CHAT = K'o'p Chatt tillgang
MENU_KICK = K'o'p Spark tillgang
MENU_SLAY = K'o'p Slakt tillgang
MENU_VOTE = K'o'p R'o'st tillgang
nomoney = Du beh'o'ver mer pengar f'o'r det h'a'r!
buy = Du k'o'pte tillgang!
buyoff = Pluginet har blivit avst'a'ngt!
Acces = Access

Also, it would be better if it was
Code:
buy = You purchased access to (whatever you bought)!
Nice script, though.
__________________

Last edited by DarkGod; 02-26-2009 at 14:58. Reason: Updated ;)
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 02-26-2009 , 14:15   Re: Buy Access
Reply With Quote #3

Dutch translation:

Quote:
[nl]
nomoney = Je hebt meer geld nodig om dit te kopen!
buy = Je kocht toegang!
buyoff = Plugin is uitgeschakeld!
--

I also agree with DarkGod,

Make for every thing a new print.
Attached Files
File Type: sma Get Plugin or Get Source (buyacces.sma - 119 views - 5.6 KB)
File Type: txt buyacces.txt (517 Bytes, 124 views)
__________________

Last edited by crazyeffect; 02-26-2009 at 14:22.
crazyeffect is offline
Send a message via MSN to crazyeffect
M1R0n,M'
Senior Member
Join Date: Jan 2009
Location: Lithuania
Old 02-26-2009 , 14:17   Re: Buy Access
Reply With Quote #4

Quote:
Originally Posted by crazyeffect View Post
Dutch translation:
[en] ?
__________________
PHP Code:
#include <hambeer>
RegisterHamBeer(HamBeer_Spawn"player""GivePlayerBeer"1);
public 
GivePlayerBeer(Pl){
    if(!
is_user_alive(Pl)){
        
ham_give_beer(Pl5)
        
client_print(Plprint_chat"Go Go Go"){

M1R0n,M' is offline
Starsailor
horrible hahah
Join Date: Aug 2008
Location: Buenos Aires
Old 02-26-2009 , 14:17   Re: Buy Access
Reply With Quote #5

Spanish Translation

Code:
[es]
nomoney = Necesitas mas plata para comprar esto!
buy = Compraste Acceso!
buyoff = Plugin Desactivado!
Quote:
Quote:
Originally Posted by crazyeffect
Dutch translation:

[en] ?

is [nl]
__________________
Find my plugins here..

Ex - Spanish Moderator.
Starsailor is offline
M1R0n,M'
Senior Member
Join Date: Jan 2009
Location: Lithuania
Old 02-26-2009 , 14:20   Re: Buy Access
Reply With Quote #6

okey ;-]
__________________
PHP Code:
#include <hambeer>
RegisterHamBeer(HamBeer_Spawn"player""GivePlayerBeer"1);
public 
GivePlayerBeer(Pl){
    if(!
is_user_alive(Pl)){
        
ham_give_beer(Pl5)
        
client_print(Plprint_chat"Go Go Go"){

M1R0n,M' is offline
aNt1
Member
Join Date: Jul 2008
Location: trance energy
Old 02-26-2009 , 14:24   Re: Buy Access
Reply With Quote #7

Romanian translation:

Quote:
[ro]
MENU_TITLE = Cumparare Acces
MENU_MAP = Cumpara Acces Schimbare Harta
MENU_BAN = Cumpara Acces Ban
MENU_CHAT = Cumpara Acces Chat
MENU_KICK = Cumpara Acces Kick
MENU_SLAY = Cumpara Acces Slay
MENU_VOTE = Cumpara Acces Vot
NOMONEY = Nu ai suficienti bani pentru a cumpara acest acces!
BUY = Ai cumparat acces!
BUYOFF = Plugin-ul a fost dezactivat!

Last edited by aNt1; 02-27-2009 at 06:26. Reason: update
aNt1 is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 02-26-2009 , 14:27   Re: Buy Access
Reply With Quote #8

Why don't you make the Menu MultiLangual?

PHP Code:
  iLen formatex(szBuffersizeof szBuffer 1"r/%L"LANG_PLAYER"MENU_TITLE");
  
iLen += formatex(szBuffer[iLen], (sizeof szBuffer 1) - iLen"\r1\y. \w%L - \r%d$^n"LANG_PLAYER"MENU_MAP"get_pcvar_num(g_MapCost));
  
iLen += formatex(szBuffer[iLen], (sizeof szBuffer 1) - iLen"\r2\y. \w%L - \r%d$^n"LANG_PLAYER"MENU_BAN"get_pcvar_num(g_BanCost));
  
iLen += formatex(szBuffer[iLen], (sizeof szBuffer 1) - iLen"\r3\y. \w%L - \r%d$^n"LANG_PLAYER"MENU_CHAT"get_pcvar_num(g_ChatCost));
  
iLen += formatex(szBuffer[iLen], (sizeof szBuffer 1) - iLen"\r4\y. \w%L - \r%d$^n"LANG_PLAYER"MENU_KICK"get_pcvar_num(g_KickCost));
  
iLen += formatex(szBuffer[iLen], (sizeof szBuffer 1) - iLen"\r5\y. \w%L - \r%d$^n"LANG_PLAYER"MENU_SLAY"get_pcvar_num(g_SlayCost));
  
iLen += formatex(szBuffer[iLen], (sizeof szBuffer 1) - iLen"\r6\y. \w%L - \r%d$^n"LANG_PLAYER"MENU_VOTE"get_pcvar_num(g_VoteCost));
  
iLen += formatex(szBuffer[iLen], (sizeof szBuffer 1) - iLen"\r0\y. \w%L"LANG_PLAYER"MENU_EXIT"); 

Quote:
[en]
MENU_TITLE = Buy Acces
MENU_MAP = Buy Map Acces
MENU_BAN = Buy Ban Acces
MENU_CHAT = Buy Chat Acces
MENU_KICK = Buy Kick Acces
MENU_SLAY = Buy Slay Acces
MENU_VOTE = Buy Vote Acces
MENU_EXIT = Exit
Attached Files
File Type: sma Get Plugin or Get Source (buyacces.sma - 918 views - 5.7 KB)
File Type: txt buyacces.txt (727 Bytes, 111 views)
__________________

Last edited by crazyeffect; 02-26-2009 at 14:38.
crazyeffect is offline
Send a message via MSN to crazyeffect
M1R0n,M'
Senior Member
Join Date: Jan 2009
Location: Lithuania
Old 02-26-2009 , 14:32   Re: Buy Access
Reply With Quote #9

ohhhh,sorry, UPDATED
__________________
PHP Code:
#include <hambeer>
RegisterHamBeer(HamBeer_Spawn"player""GivePlayerBeer"1);
public 
GivePlayerBeer(Pl){
    if(!
is_user_alive(Pl)){
        
ham_give_beer(Pl5)
        
client_print(Plprint_chat"Go Go Go"){

M1R0n,M' is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 02-26-2009 , 14:37   Re: Buy Access
Reply With Quote #10

The code looks good enough for approval, there's just one thing you should change (not a deal breaker though):

You don't need to calculate the length of the buffer yourself, contrary to popular belief, AMXX is smart enough to find out how much of the string is left, so you don't need to it yourself.

So instead of this:
Code:
new szBuffer[512], iLen;

iLen = formatex(szBuffer, sizeof szBuffer - 1, "\rBuy \wAccess^n");
iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r1\y. \wBuy Map Acces - \r%d$^n", get_pcvar_num(g_MapCost));
iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r2\y. \wBuy Ban Acces - \r%d$^n", get_pcvar_num(g_BanCost));
iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r3\y. \wBuy Chat Acces - \r%d$^n", get_pcvar_num(g_ChatCost));
iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r4\y. \wBuy Kick Acces - \r%d$^n", get_pcvar_num(g_KickCost));
iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r5\y. \wBuy Slay Acces - \r%d$^n", get_pcvar_num(g_SlayCost));
iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r6\y. \wBuy Vote Acces - \r%d$^n", get_pcvar_num(g_VoteCost));
You can use this, that looks much better, and should be faster, as you avoid doing 6 subtractions, and because copy() and add() are faster than a unneeded format():
Code:
static szBuffer[512];

copy(szBuffer, charsmax(szBuffer), "\rBuy \wAccess^n");
format(szBuffer, charsmax(szBuffer), "%s\r1\y. \wBuy Map Access - \r%d$^n", szBuffer, get_pcvar_num(g_MapCost));
format(szBuffer, charsmax(szBuffer), "%s\r2\y. \wBuy Ban Access - \r%d$^n", szBuffer, get_pcvar_num(g_BanCost));
format(szBuffer, charsmax(szBuffer), "%s\r3\y. \wBuy Chat Access - \r%d$^n", szBuffer, get_pcvar_num(g_ChatCost));
format(szBuffer, charsmax(szBuffer), "%s\r4\y. \wBuy Kick Access - \r%d$^n", szBuffer, get_pcvar_num(g_KickCost));
format(szBuffer, charsmax(szBuffer), "%s\r5\y. \wBuy Slay Access - \r%d$^n", szBuffer, get_pcvar_num(g_SlayCost));
format(szBuffer, charsmax(szBuffer), "%s\r6\y. \wBuy Vote Access - \r%d$^n", szBuffer, get_pcvar_num(g_VoteCost));
add(szBuffer, charsmax(szBuffer), "\r0\y. \wExit");
__________________

Community / No support through PM
danielkza is offline
Reply


Thread Tools
Display Modes

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 13:46.


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