need help with random messages
#1

Onplayerdeath i want to send a message like: killerid suprised playerid
what i have now:

pawn Код:
new RandomMSG[][] =
    {
    "%s Plugged %s",
    "%s Crossed Out %s",
    "%s Pulverized %s",
    "%s Set Down %s",
    "%s Cancelled %s",
    "%s Peppered %s",
    "%s Killed %s",
    "%s Surprised %s",
    "%s Sprayed %s",
    "%s Massacred %s",
    "%s Blasted %s",
    "%s Fucked Up %s",
    "%s Slaughtered %s"
    };
    new randMSG = random(sizeof(RandomMSG));
    SendClientMessageToAll(COLOR_WHITE, RandomMSG[randMSG]);
the problem is,, %s doesnt show the killername or victim

please help
Reply
#2

Код:
new RandomMSG[][] =
    {
    "%s Plugged %s",
    "%s Crossed Out %s",
    "%s Pulverized %s",
    "%s Set Down %s",
    "%s Cancelled %s",
    "%s Peppered %s",
    "%s Killed %s",
    "%s Surprised %s",
    "%s Sprayed %s",
    "%s Massacred %s",
    "%s Blasted %s",
    "%s Fucked Up %s",
    "%s Slaughtered %s"
    };
    new randMSG = random(sizeof(RandomMSG));
    SendClientMessageToAll(COLOR_WHITE, RandomMSG[randMSG]);
change to :

Код:
    new sendername[MAX_PLAYER_NAME];
    new giveplayer[MAX_PLAYER_NAME];
    new RandomMSG[][] =
    {
    "%s Plugged %s",
    "%s Crossed Out %s",
    "%s Pulverized %s",
    "%s Set Down %s",
    "%s Cancelled %s",
    "%s Peppered %s",
    "%s Killed %s",
    "%s Surprised %s",
    "%s Sprayed %s",
    "%s Massacred %s",
    "%s Blasted %s",
    "%s Fucked Up %s",
    "%s Slaughtered %s"
    };
    new randMSG = random(sizeof(RandomMSG));
    SendClientMessageToAll(COLOR_WHITE, RandomMSG[randMSG], giveplayer, sendername);
Try i think it would work.
Reply
#3

doesnt work

warning 202: number of arguments does not match definition
Reply
#4

Put the
Quote:

SendClientMessageToAll(COLOR_WHITE, RandomMSG[randMSG], giveplayer, sendername);

in the OnPlayerDeath
Reply
#5

i did but it aint gonna work because the sendername or giveplayer aint gonna show the killerid or the victim
Reply
#6

Quote:

new killer[MAX_PLAYER_NAME];
new dier[MAX_PLAYER_NAME];
format(string, sizeof(string), RandomMSG[randMSG],killer,dier);
SendClientMessageToAll(COLOR_WHITE, string);

This will work
Reply
#7

ive got it working:
pawn Код:
new randMSG = random(sizeof(RandomMSG));
    new string[64], fName[MAX_PLAYER_NAME], sName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,fName,MAX_PLAYER_NAME);
    GetPlayerName(killerid,sName,MAX_PLAYER_NAME);
    format(string,sizeof(string),RandomMSG[randMSG],sName,fName);
    SendClientMessageToAll(COLOR_WHITE,string);
thanks for helping!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)