Argument Mismatch - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Argument Mismatch (
/showthread.php?tid=76653)
Argument Mismatch -
Robbin237 - 05.05.2009
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!
Re: Argument Mismatch -
Robbin237 - 05.05.2009
BUMP