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

Array must be indexed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nicker
Junior Member
Join Date: Dec 2020
Old 12-27-2020 , 10:41   Array must be indexed
Reply With Quote #1

What's the problem here?
HTML Code:
public Action DajCos(int client, int args) {
    if (args != 2) {
        ReplyToCommand(client, "[SM] Usage: sm_givecos <nick> <cos>");
        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) {
        Cos[target] += argument2; // ERROR array must be indexec(variable "argument2")
        Cos[client] -= argument2; // ERROR array must be indexec(variable "argument2")
    }
    return Plugin_Handled;
}

Last edited by Nicker; 12-27-2020 at 10:42.
Nicker is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 12-27-2020 , 12:10   Re: Array must be indexed
Reply With Quote #2

StringToInt(argument2)
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami 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:00.


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