AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [HELP] need this plugin once per map (https://forums.alliedmods.net/showthread.php?t=338519)

Taha_rajper 07-09-2022 23:47

[HELP] need this plugin once per map
 
Can Anyone change this plugin and set it Only One Time per Map allowed , Players can spam /getxp and keep getting xp ? pls help

PHP Code:

#include <amxmodx>
#include <cromchat>
#include <crxranks>

public plugin_init()
{
    
register_plugin("CRXRanks: GetXP Cmd""1.0""OciXCrom")
    
register_clcmd("say /getxp""Cmd_GetXP")
    
register_clcmd("say_team /getxp""Cmd_GetXP")
    
crxranks_get_chat_prefix(CC_PREFIXcharsmax(CC_PREFIX))
}

public 
Cmd_GetXP(id)
{
    if(
get_user_flags(id) & ADMIN_LEVEL_B)
    {
        new 
iRandom random_num(50150)
        
crxranks_give_user_xp(idiRandom)
        
CC_SendMessage(id"Yay! You received &x04%i XP&x01!"iRandom)
    }
    else
    {
        
CC_SendMessage(id"You have no access to this command.")
    }

    return 
PLUGIN_HANDLED



Natsheh 07-10-2022 03:38

Re: [HELP] need this plugin once per map
 
PHP Code:

new bool:g_bXPGiftRetrieved[33]

public 
Cmd_GetXP(id)
{
    if(!
g_bXPGiftRetrieved[id] && get_user_flags(id) & ADMIN_LEVEL_B)
    {
        new 
iRandom random_num(50150); g_bXPGiftRetrieved[id] = true;
        
crxranks_give_user_xp(idiRandom)
        
CC_SendMessage(id"Yay! You received &x04%i XP&x01!"iRandom)
    }
    else
    {
        
CC_SendMessage(id"You have no access to this command.")
    }

    return 
PLUGIN_HANDLED



OciXCrom 07-10-2022 07:17

Re: [HELP] need this plugin once per map
 
What was the point of creating a new thread?
The above plugin won't work properly. That's once per player id, not once per map.

Natsheh 07-10-2022 08:39

Re: [HELP] need this plugin once per map
 
Quote:

Originally Posted by OciXCrom (Post 2783448)
What was the point of creating a new thread?
The above plugin won't work properly. That's once per player id, not once per map.

Actually that's exactly what author requested, he wanted it to be available for each player once per map, but you cannot expect everyone to explain their request properly.

OciXCrom 07-10-2022 10:05

Re: [HELP] need this plugin once per map
 
In a game where no players can join and leave until the map ends, sure, then it will work.


All times are GMT -4. The time now is 10:19.

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