SA-MP Forums Archive
Problem - 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: Problem (/showthread.php?tid=145349)



Problem - Bomber - 01.05.2010

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


Re: Problem - Miguel - 01.05.2010

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



Re: Problem - [DRD]Rodney - 01.05.2010

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!");



Re: Problem - Bomber - 01.05.2010

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 !


Re: Problem - Bomber - 01.05.2010

Still it shows wrong weapon name !


Re: Problem - Bomber - 02.05.2010

BUMP !


Re: Problem - Bomber - 02.05.2010

Still no help ?


Re: Problem - 0ne - 02.05.2010

new weaponid = GetPlayerWeapon(killerid);

replaced the playerid of getplayerweapon to killerid.


Re: Problem - Bomber - 03.05.2010

I didn't understand..

Can someone explane it ?


Re: Problem - 0ne - 03.05.2010

You made a :

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