SA-MP Forums Archive
argument type 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 type mismatch (/showthread.php?tid=128559)



argument type mismatch - jamesbond007 - 18.02.2010

this is my code :

public OnPlayerDeath(playerid,killerid,reason)
{
new str[80],name[2][MAX_PLAYER_NAME];

SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid)+1);
SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
SetPlayerScore(playerid, GetPlayerScore(playerid)-1);
GivePlayerMoney(killerid,13337);
SendDeathMessage(killerid, playerid, reason);

if(killerid != INVALID_PLAYER_ID)
{
GetPlayerName(playerid,name[0],MAX_PLAYER_NAME);
GetPlayerName(killerid,name[1],MAX_PLAYER_NAME);
format(str,sizeof(str),"%s has been killed by %s",name[0],name[1]);
SendClientMessage(playerid, 0xBB0000FF,str);
}
return 1;
}


In SendClientMessage when i change it to SendClientMessageToAll because i want everyone to see it, it gives me an error 035: argument type mismatch (argument 2)

please help me! , thank you


Re: argument type mismatch - Eazy_Efolife - 18.02.2010

Код:
public OnPlayerDeath(playerid,killerid,reason)
{
  new str[80],name[2][MAX_PLAYER_NAME];
  
	SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid)+1);
	SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
	SetPlayerScore(playerid, GetPlayerScore(playerid)-1);
	GivePlayerMoney(killerid,13337);
	SendDeathMessage(killerid, playerid, reason);
	
  if(killerid != INVALID_PLAYER_ID)
  {
    GetPlayerName(playerid,name[0],MAX_PLAYER_NAME);
		GetPlayerName(killerid,name[1],MAX_PLAYER_NAME);
    format(str,sizeof(str),"%s has been killed by %s",name[0],name[1]);
		SendClientMessageToAll(0xBB0000FF,str);
  }
  return 1;
}
Try that.


Re: argument type mismatch - jamesbond007 - 18.02.2010

genius thank you