Problem
#1

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if( WarZone[killerid] >= 1)
    {
    new weaponid = GetPlayerWeapon(playerid);
  new WeaponName[128];
    GetWeaponName(weaponid, WeaponName, sizeof WeaponName);
    new str[128],playersname[24],killersname[24];
    GetPlayerName(playerid,playersname,24);
    GetPlayerName(killerid,killersname,24);
    if(killerid != INVALID_PLAYER_ID)
    {
//  format(string, sizeof string, "[KILL] %s has been killed by %s [WEAPON: %s]",playersname,killersname,WeaponName);
    format(str,sizeof(str),"[KILL] %s has been killed by %s [WEAPON: %s] ",playersname,killersname,WeaponName);
    }
    else format(str,sizeof(str),"%s has died.",playersname);
    SendClientMessageToAll(COLOR_YELLOW,str);
    GivePlayerMoney(killerid, 1000);
    SetPlayerScore(killerid,GetPlayerScore(killerid)+2);
    }
    if( WarZone[killerid] == 0)
    {
    GivePlayerMoney(killerid, 1000);
    SetPlayerScore(killerid,GetPlayerScore(killerid)+2);
    SendClientMessage(killerid, COLOR_RED,"Dont Kill People Out Of DeathMatching Areas! You Are Fined -3000 and -3 Points!");
    SetPlayerHealth(playerid, 0.00);
    }
    return 1;
}
So,
If i kill anybody in war zone then it shows wrong weapon name..
pawn Код:
format(str,sizeof(str),"[KILL] %s has been killed by %s [WEAPON: %s] ",playersname,killersname,WeaponName);
Whats wrong ? I have 0 error
Reply
#2

Quote:
Originally Posted by Bomba || ❶❸❸❼
pawn Код:
GetWeaponName(weaponid, WeaponName, sizeof WeaponName);
pawn Код:
GetWeaponName(weaponid, WeaponName, sizeof(WeaponName));
Reply
#3

This is wrong :P

SetPlayerScore(killerid,GetPlayerScore(killerid)+2 );
SendClientMessage(killerid, COLOR_RED,"Dont Kill People Out Of DeathMatching Areas! You Are Fined -3000 and -3 Points!");
Reply
#4

Quote:
Originally Posted by SAWC™
Quote:
Originally Posted by Bomba || ❶❸❸❼
pawn Код:
GetWeaponName(weaponid, WeaponName, sizeof WeaponName);
pawn Код:
GetWeaponName(weaponid, WeaponName, sizeof(WeaponName));
Thanks, gonna test it

Quote:
Originally Posted by [DRD
Rodney ]
This is wrong :P

SetPlayerScore(killerid,GetPlayerScore(killerid)+2 );
SendClientMessage(killerid, COLOR_RED,"Dont Kill People Out Of DeathMatching Areas! You Are Fined -3000 and -3 Points!");
Haha, lol, yea, my mistake !
Reply
#5

Still it shows wrong weapon name !
Reply
#6

BUMP !
Reply
#7

Still no help ?
Reply
#8

new weaponid = GetPlayerWeapon(killerid);

replaced the playerid of getplayerweapon to killerid.
Reply
#9

I didn't understand..

Can someone explane it ?
Reply
#10

You made a :

pawn Код:
new weaponid = GetPlayerWeapon(playerid);
Replace the (PLAYERID) with (KILLERID)
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)