Tag mismatch error and not working code

Discussion in 'Threads' started by the133448, Sep 13, 2017.

  1. the133448

    the133448 Guest

    Hello, what Im trying to do here after a playerteam event loop through all the players and send them a message, and if the player in the loop is the player from the event send them a differnt message.
    At the moment sending the player a differnt message works but sending other player messages dont. I get a tag mismatch warning in the final if statment, which I dont undedrstand as both variables are ints.

    Code:
    public Action Event_PlayerTeam(Event evEvent, char[] szEvent, bool bDontBroadcast)
    {
    int iUserId = evEvent.GetInt("userid");
    int iClient = GetClientOfUserId(iUserId);

    if (iClient <= 0 || iClient > MaxClients || view_as<bool>(evEvent.GetInt("disconnect"))) {
    return Plugin_Continue;
    }

    for (int i = 1; i <= GetMaxClients(); i++)
    {
    if (IsValidClient(i) && !IsFakeClient(i))
    {
    int targetPlayer = i;
    PrintToChat(iClient, "You are: [%i] and player refrence is: [%i]", iClient, targetPlayer);
    if(!targetPlayer==iClient) //TAG MISMATCH WARNING
    PrintToChat(i, "You are the player from the event");
    else
    PrintToChat(i, "PLAYER!HWEAH");
    }

    }
    }​
     

Share This Page

Forums Teetk

Teetk

Forums