Help for [ZP]Reward menu
Hello!
I am a new in scripting and i need help to make a Reward Menu that gives a certain rewards for a certain amounts of kills i have made the menu but the functions are hard for me to set. Code:
#include <amxmodx> |
Re: Help for [ZP]Reward menu
1. Don't hardcode numbers.
g_szName[32] -> g_szName[MAX_NAME_LENGTH] g_szSteamID[32] -> g_szSteamID[MAX_AUTHID_LENGTH] new g_PlayerInfo[33][PlayerData] -> new g_PlayerInfo[MAX_PLAYERS+1][PlayerData] P.S. I wrote this taking into account that you aren't using AMXX 1.8.2. In the case you're using it, just add: PHP Code:
PHP Code:
3. If you use more than once a native so save it to a variable. PHP Code:
|
Re: Help for [ZP]Reward menu
Ok i have changed the code but still it doesnt work properly and i also want to make the rewards not spammable...
Code:
/* Plugin generated by AMXX-Studio */Code:
/*Возвращает деньги игрока*/ |
Re: Help for [ZP]Reward menu
What is this?
new iPlayer = get_user_name(id, g_PlayerInfo[id][g_szName], charsmax(g_PlayerInfo[][g_szName])) PHP Code:
So you don't need to do what you're doing. Remove that code and change "iPlayer" IN "zp_set_user_exp(iPlayer..." to "id". If you want to do the players take the reward only once you can use trie/array. |
Re: Help for [ZP]Reward menu
Ok it actually works but I don't know how to set the reward to be taken only once and the 2nd thing is the i put a messages if have the requirements and if you don't have them... but if you have 0 kills left the both messages pop up how to prevent the false trigger to happen?
Code:
#include <amxmodx> |
Re: Help for [ZP]Reward menu
Because you need to use else if instead of the second if because you don't need to check the same twice.
PHP Code:
|
Re: Help for [ZP]Reward menu
I don't really know how to make a code for this but i think that the best native for the job will be this
Code:
TrieSetString(Trie:handle, const key[], const value[]) |
Re: Help for [ZP]Reward menu
There is a lot of examples here and in other forums. That can be useful if you want to do taking only one reward (per map for example).
|
Re: Help for [ZP]Reward menu
Quote:
Quote:
|
| All times are GMT -4. The time now is 07:31. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.