Author Topic: Someone help me!!  (Read 2851 times)

0 Members and 1 Guest are viewing this topic.

Offline Fuzzy168

  • VC:MP Veteran
  • *****
  • Posts: 729
  • Programming since 2011
    • View Profile
Someone help me!!
« 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..
I'm beginning to feel like a Lag God, Lag God

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: Someone help me!!
« Reply #1 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...
« Last Edit: July 22, 2011, 01:02:13 pm by sseebbyy »

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline aXXo

  • Wiseguy
  • **
  • Posts: 50
    • View Profile
Re: Someone help me!!
« Reply #2 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.

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: Someone help me!!
« Reply #3 on: July 22, 2011, 01:00:17 pm »
oh...ya...sorry  :o

Is good your script  ...

My Sorry.

Me not use gPlayers...

« Last Edit: July 22, 2011, 01:15:33 pm by sseebbyy »

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline Fuzzy168

  • VC:MP Veteran
  • *****
  • Posts: 729
  • Programming since 2011
    • View Profile
Re: Someone help me!!
« Reply #4 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]
« Last Edit: July 25, 2011, 06:04:36 am by Fuzzy168 »
I'm beginning to feel like a Lag God, Lag God