error 035: argument type mismatch (argument 2)
#1

PHP код:
        format(stringsizeof(string), "%s (%i) Killed %s (%i) - %s (%s) From %0.2fm Away."KillerNameissueridVictimNameplayeridWeaponNamebodypartPfPDistance);
        
SendClientMessageToAll(playerid0x9D000096string); // here is the error 
Reply
#2

Код:
SendClientMessageToAll(0x9D000096, string);
Reply
#3

it fixed but when it kill player the message not showing to all .. dont work i mean

here's onplayerdeath

Quote:

public OnPlayerDeath(playerid, killerid, reason)
{
DeadPlayer[playerid] = 0;
SetPlayerColor(playerid, COLOR_DEAD);
PlayerInfo[killerid][pKills]++;
PlayerInfo[playerid][pDeaths]++;
TextDrawHideForPlayer(playerid,Clock);
TextDrawHideForPlayer(playerid, DaysOfWeek);
TextDrawHideForPlayer(playerid, FpsAndPing[playerid]);
TextDrawHideForPlayer(playerid, ZoneName[playerid]);
HideTDs(playerid);
return 1;
}

here's OnplayerTakeDamage

Quote:

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
new Floatldhealth; // victim health before taking damage
GetPlayerHealth(playerid,oldhealth); // victim health before taking damage
new currenthp = oldhealth - amount; // calculating current health after taking damage
if(currenthp == 0.0) {
new
Float:kx, Float:ky, Float:kz,
string[156],
WeaponName[24],
VictimName[MAX_PLAYER_NAME],
KillerName[MAX_PLAYER_NAME];
// killer coordinates variables
GetPlayerPos(issuerid, kx, ky, kz);
// their positions and distance between them
new Float: PfPDistance = GetPlayerDistanceFromPoint(playerid, kx, ky, kz);
GetPlayerName(playerid, VictimName, sizeof (VictimName));
GetPlayerName(issuerid, KillerName, sizeof (KillerName));
GetWeaponName(weaponid, WeaponName, sizeof (WeaponName));
format(string, sizeof(string), "%s (%i) Killed %s (%i) - %s (%s) From %0.2fm Away.", KillerName, issuerid, VictimName, playerid, WeaponName, bodypart, PfPDistance);
SendClientMessageToAll(playerid, 0x9D000096, string);
}
return 1;
}

Reply
#4

You can do most of those thing just under OnPlayerDeath.The only thing you can't know on OnPlayerDeath is the bodypart.
PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    if(
killerid != INVALID_PLAYER_ID)
    {
        new 
string[128], weapon[32], killerName[MAX_PLAYER_NAME], playerName[MAX_PLAYER_NAME],
        
Float:pXFloat:pYFloat:pZFloatPfPDistance;
        
GetPlayerName(killeridkillerNamesizeof(killerName));
        
GetPlayerName(playeridplayerNamesizeof(playerName));
        
GetWeaponName(reasonweaponsizeof(weapon));
        
GetPlayerPos(playeridpXpYpZ);
        
PfPDistance GetPlayerDistanceFromPoint(killeridpXpYpZ);
        
format(stringsizeof(string), "%s (%i) Killed %s (%i) - %s From %0.2fm Away."killerNamekilleridplayerNameplayeridweaponPfPDistance); 
        
SendClientMessageToAll(0x9D000096string); 
        
//
        
PlayerInfo[killerid][pKills]++;
    }
    
DeadPlayer[playerid] = 0;
    
SetPlayerColor(playeridCOLOR_DEAD); 
    
PlayerInfo[playerid][pDeaths]++; 
    
TextDrawHideForPlayer(playerid,Clock); 
    
TextDrawHideForPlayer(playeridDaysOfWeek); 
    
TextDrawHideForPlayer(playeridFpsAndPing[playerid]); 
    
TextDrawHideForPlayer(playeridZoneName[playerid]); 
    
HideTDs(playerid); 
    return 
1

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)