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

Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nicker
Junior Member
Join Date: Dec 2020
Old 12-27-2020 , 17:57   Problem
Reply With Quote #1

Hi i need help with this
HTML Code:
public Action Daj(int client, int args) {
    if (args != 2) {
        ReplyToCommand(client, "[SM] Usage: sm_daj <nick> <ilosc>");
        return Plugin_Handled;
    }
    char argument1[64];
    char argument2[32];
    GetCmdArg(1, argument1, sizeof(argument1));
    GetCmdArg(2, argument2, sizeof(argument2));
    int target = FindTarget(client, argument1);

    if (target > -1 && coss[client] >= StringToInt(argument2)) {
        coss[target] += StringToInt(argument2); s
        coss[client] -= StringToInt(argument2);
        ReplyToCommand(target, "%s you get %d coins from player %N ", TAG, argument2, client);
        ReplyToCommand(client, "%s you give player %N %d coins", TAG, target, argument2);
    }
    return Plugin_Handled;
}
when i say sm_daj nickname 10 i have this message
[tag] you get 2002871415 coins from player nickname
[tag] you give player nickname 2002871415 coins
but player get only 10 coins what i do wrong?
Nicker is offline
SSheriFF
AlliedModders Donor
Join Date: May 2020
Location: Israel
Old 12-27-2020 , 18:13   Re: Problem
Reply With Quote #2

Quote:
Originally Posted by Nicker View Post
Hi i need help with this
HTML Code:
public Action Daj(int client, int args) {
    if (args != 2) {
        ReplyToCommand(client, "[SM] Usage: sm_daj <nick> <ilosc>");
        return Plugin_Handled;
    }
    char argument1[64];
    char argument2[32];
    GetCmdArg(1, argument1, sizeof(argument1));
    GetCmdArg(2, argument2, sizeof(argument2));
    int target = FindTarget(client, argument1);

    if (target > -1 && coss[client] >= StringToInt(argument2)) {
        coss[target] += StringToInt(argument2); s
        coss[client] -= StringToInt(argument2);
        ReplyToCommand(target, "%s you get %d coins from player %N ", TAG, argument2, client);
        ReplyToCommand(client, "%s you give player %N %d coins", TAG, target, argument2);
    }
    return Plugin_Handled;
}
when i say sm_daj nickname 10 i have this message
[tag] you get 2002871415 coins from player nickname
[tag] you give player nickname 2002871415 coins
but player get only 10 coins what i do wrong?
Change
PHP Code:
ReplyToCommand(target"%s you get %d coins from player %N "TAGargument2client);
ReplyToCommand(client"%s you give player %N %d coins"TAGtargetargument2); 
To
PHP Code:
ReplyToCommand(target"%s you get %d coins from player %N "TAGStringToInt(argument2), client);
ReplyToCommand(client"%s you give player %N %d coins"TAGtargetStringToInt(argument2)); 
__________________
Taking small private requests (Free) and big private requests (Paid).
Contact me via Discord: WilDick#1524

My Plugins:
SSheriFF 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 05:51.


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