Argument Mismatch
#1

Hi guys, im trying to make a simple function to see if the owner of the house is connected.
But im getting a few argument mismatches, can somebody help me? Cant find out how to fix them

Function:

pawn Код:
public OwnerConnected(playerid, name)
{
  new pName[MAX_PLAYER_NAME+1];

  for(new i=0; i<MAX_PLAYERS; i++) {
    if(IsPlayerConnected(i)) {
      GetPlayerName(i, pName, sizeof(pName));

      if(!strcmp(pName, name)) {
        OwnerID[playerid] = GetPlayerID(name);
      }
    }
  }

  if(OwnerID[playerid] != -1) {
    return 1;
  } else {
    return 0;
  }
}
This is how i check it:

pawn Код:
if (OwnerConnected(House_1_Owner) == 0) print("Owner is not connected!");
Then this is how i get the House_1_owner:

pawn Код:
new House_1_Owner[MAX_STRING];
pawn Код:
House_1_Owner = dini_Get("DCMain/DCHouses/House_1.ini", "Owner");
These are the errors im getting:

pawn Код:
E:\_Spellen\bkp\filterscripts\enterinteriors.pwn(160) : error 035: argument type mismatch (argument 1)
E:\_Spellen\bkp\filterscripts\enterinteriors.pwn(298) : error 035: argument type mismatch (argument 2)
E:\_Spellen\bkp\filterscripts\enterinteriors.pwn(299) : error 035: argument type mismatch (argument 1)
Line 160
pawn Код:
if(OwnerConnected(House_1_Owner) == 0) print("owner not connected");
Line 298
pawn Код:
if(!strcmp(pName, name)) {
Line 299
pawn Код:
OwnerID[playerid] = GetPlayerID(name);
Can somebody fix this for me? I cant see whats wrong about this.

Thnx!
Reply
#2

BUMP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)