SA-MP Forums Archive
need help with random messages - 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: need help with random messages (/showthread.php?tid=271921)



need help with random messages - Woozie® - 26.07.2011

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


Re: need help with random messages - gold - 26.07.2011

Код:
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.


Re: need help with random messages - Woozie® - 26.07.2011

doesnt work

warning 202: number of arguments does not match definition


Re: need help with random messages - gold - 26.07.2011

Put the
Quote:

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

in the OnPlayerDeath


Re: need help with random messages - Woozie® - 26.07.2011

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


Re: need help with random messages - gold - 26.07.2011

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


Re: need help with random messages - Woozie® - 26.07.2011

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!