How can I do this? - 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: How can I do this? (
/showthread.php?tid=239595)
How can I do this? -
grand.Theft.Otto - 14.03.2011
When someone dies, I want it to show random game text on the screen for the person who died, for example if I use game text style 6, it will show the random text at the top of the screen when they die. The random messages would be
Код:
Merked
Fail /q
/cry
Fail pause
lol y u suck tho?
u rly suck
Anyone know?
Re: How can I do this? -
admantis - 14.03.2011
pawn Код:
new RandomDeathMessages[] = { Merked, Fail /q, /cry, Fail pause, lol y u suck tho?, u rly suck, };
pawn Код:
// add this under onplayerdeath
new msg_holder = random(sizeof(RandomDeathMessages));
GameTextForPlayer(playerid, msg_holder, 5000, 6);
Re: How can I do this? -
grand.Theft.Otto - 14.03.2011
Thanks, but I get 2 errors
pawn Код:
C:\Documents and Settings\User\Desktop\Las Venturas True Crime\gamemodes\lvtc.pwn(17) : error 001: expected token: ";", but found "-identifier-"
C:\Documents and Settings\User\Desktop\Las Venturas True Crime\gamemodes\lvtc.pwn(2054) : error 035: argument type mismatch (argument 2)
Lines:
pawn Код:
/* LINE 17 */ new RandomDeathMessages[] = { Merked, Fail /q, /cry, Fail pause, lol y u suck tho?, u rly suck, pwnt, scrapped, murdered, t/report, };
/* LINE 2054 */ GameTextForPlayer(playerid,msg_holder,5000,6);
Re: How can I do this? -
admantis - 14.03.2011
pawn Код:
new RandomDeathMessages[] = { Merked, Fail /q, /cry, Fail pause, lol y u suck tho?, u rly suck };
if it doesn't work tell me and i'll give you other solution; i forgot how to do this now.
Re: How can I do this? -
grand.Theft.Otto - 14.03.2011
Still gives me the expected token error (line 17 above)
Maybe its the wrong brackets?
Re: How can I do this? -
admantis - 14.03.2011
you can try this..
p.s: I can guarantee this will work
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
switch (random(10))
{
case 0: GameTextForPlayer(playerid, "merked", 5000, 6);
case 1: GameTextForPlayer(playerid, "fail /q", 5000, 6);
case 2: GameTextForPlayer(playerid, "/cry", 5000, 6);
case 3: GameTextForPlayer(playerid, "fail pause", 5000, 6);
case 4: GameTextForPlayer(playerid, "lol y u suck tho?", 5000, 6);
case 5: GameTextForPlayer(playerid, "u rly suck", 5000, 6);
case 6: GameTextForPlayer(playerid, "pwnt", 5000, 6);
case 7: GameTextForPlayer(playerid, "scrapped", 5000, 6);
case 8: GameTextForPlayer(playerid, "murdered", 5000, 6);
case 9: GameTextForPlayer(playerid, "t/report", 5000, 6);
}
return 1;
}
sorry for my noobism lol
Re: How can I do this? -
grand.Theft.Otto - 14.03.2011
lol, its ok and thanks but it's still giving the expected token error on line 17 where the new variable starts ahaha
Re: How can I do this? -
admantis - 14.03.2011
just delete it lol, delete the other code I gave you
Respuesta: How can I do this? -
Alex_Obando - 14.03.2011
Admantis, Can you please check this :/
https://sampforum.blast.hk/showthread.php?tid=187229&page=57
At the bottom
Re: Respuesta: How can I do this? -
admantis - 14.03.2011
Quote:
Originally Posted by Alex_Obando
|
sorry, I don't use IRC.