View Single Post
Author Message
client21
Senior Member
Join Date: Apr 2013
Old 04-24-2013 , 13:28   error 035: argument type mismatch (argument 2)
Reply With Quote #1

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>

public OnPluginStart()
{
    
RegConsoleCmd("test"test);
}

public 
Action:test(clientargs)
{
    if (!(
client <= MaxClients))
        return 
Plugin_Handled;

    
decl player_list[MaxClients]; new players 0;
    for (new 
1<= MaxClientsi++)
    {
        if (
IsClientInGame(i) && IsPlayerAlive(i)) player_list[players++] = i;
    }
    
Shake_(player_listplayers);

    return 
Plugin_Handled;
}

Shake_(const player_list[], const players)
{
    if (
players 1)
        return;

    new 
Handle:Message StartMessage("Shake"player_listplayers); // error 035: argument type mismatch (argument 2)
    
if (Message != INVALID_HANDLE)
    {
        
// blabla (not important)
    
}

To avoid this error, I must to do this:

PHP Code:
Shake_(const player_list[], const players)
{
    if (
players 1)
        return;

    
decl list[players];
    for (new 
0playersi++)
        list[
i] = player_list[i];

    new 
Handle:Message StartMessage("Shake", list, players);

I do not understand what is wrong in the first variant.
I understand I can do without the function "Shake_"

Last edited by client21; 04-24-2013 at 13:34.
client21 is offline