Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: Fuzzy168 on July 22, 2011, 06:57:51 am

Title: Someone help me!!
Post by: Fuzzy168 on July 22, 2011, 06:57:51 am
Can someone test this script for me? I have IP problem.. :-\

[pawn]public OnPlayerDeath(playerid, killerid, reason)
{
   new string[51];
   format(string, sizeof(string), "%s has been killed by %s", gPlayers[playerid], gPlayers[killerid]);
   SendClientMessageToAll(COLOR_GREEN, string);
    return 1;
}[/pawn]
Please tell me if it works. And please post screenshot..
Title: Re: Someone help me!!
Post by: sseebbyy on July 22, 2011, 09:45:27 am
Not Works, because you put "%s" and needed "%d"


public OnPlayerDeath(playerid, killerid, reason)
{
   new string[22];
   format(string, sizeof(string), "%d has been killed by %d", gPlayers[playerid], gPlayers[killerid]);
   SendClientMessageToAll(COLOR_GREEN, string);
    return 1;
}

For Numbers, [Playerid is a number] need "%d".

For Names, need "%s".

String is big for this message !

Is very good my string. [ new string[22] ]


My sorry, is good...
Title: Re: Someone help me!!
Post by: aXXo on July 22, 2011, 12:43:40 pm
Not Works, because you put "%s" and needed "%d"

What?
It should be %s, he is printing the player name, not ID.
Title: Re: Someone help me!!
Post by: sseebbyy on July 22, 2011, 01:00:17 pm
oh...ya...sorry  :o

Is good your script  ...

My Sorry.

Me not use gPlayers...

Title: Re: Someone help me!!
Post by: Fuzzy168 on July 22, 2011, 03:45:17 pm
Test this script I just modified..
[pawn]public OnPlayerDeath(playerid, killerid, reason)
{
   new string[51];
   format(string, sizeof(string), "%s has been killed by %s with a %s", gPlayers[playerid], gPlayers[killerid], gWeapons[killerid]);
   SendClientMessageToAll(COLOR_GREEN, string);
   GivePlayerMoney(killerid, 250);
   GivePlayerWeapon(killerid, 26, 270);
   SendClientMessage(killerid, COLOR_GREEN, "You will be upgraded with M4 but limited ammo. Kill somemore to earn more ammo.");
    return 1;
}[/pawn]