What's wrong with this code?
#1

I'm trying to store a player's information when they send someone a duel request, but keep getting the error "Argument Type Mismatch (Argument 1)". My code:

Код:
new id[128],amount[128], weapon1[123], weapon2[123], weapon3[123];
id = strtok(cmdtext, idx);
amount = strtok(cmdtext, idx);
weapon1 = strtok(cmdtext, idx);
weapon2 = strtok(cmdtext, idx);
weapon3 = strtok(cmdtext, idx);

duelStore(playerid, strval(id), strval(amount), GetWeaponID(weapon1), GetWeaponID(weapon2), GetWeaponID(weapon3));
and this one in an include (note that i DID include this file in the header):

Код:
duelStore(whoSentID, sentToID, Amount, Weapon1, Weapon2, Weapon3){
	duelInfo[whoSentID][sentID] = whoSentID;
	duelInfo[whoSentID][ToID] = sentToID;
	duelInfo[whoSentID][price] = Amount;
	duelInfo[whoSentID][w1] = Weapon1;
	duelInfo[whoSentID][w2] = Weapon2;
	duelInfo[whoSentID][w3] = Weapon3;
}
Even if I remove everything from that function 'duelStore' and recompile, I still get the error. Also, this code is under the 'OnPlayerCommandText' function. Since it's argument 1, the problem is in 'playerid' but I don't see how one integer can be a mismatch to another?
Reply
#2

what line give the error?
Reply
#3

Nevermind, found my mistake. "GetWeaponID(weapon1)....." the getweaponid function was made to accept int only and i gave string variables.
Reply
#4

so GetWeaponID(strval(weaponN))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)