Message when an object spawn [PLS!] - 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: Message when an object spawn [PLS!] (
/showthread.php?tid=221736)
Message when an object spawn [PLS!] -
Nano_UY - 06.02.2011
Hi ppl from SA-MP help me with this!
Ok what i need help with:
Im trying to create a fs where a pickup randomy spawns and if a player get it he earns 50k. Thats not the problem, the problem is that I want the fs to announce on public chat for example: "The moneybag has spawned in Foster Valley" so the players know there is a mb and they know where to get it. But ive done everything, and it just doesen't say the msg, ill hand you the fs so you can help me.
http://pastebin.com/BUie6XQB
If there's anything you don't undertand let me know and I'll try to explain it better.
Re: Message when an object spawn [PLS!] -
On_Top_Non_Stop - 06.02.2011
There's a little mistake under OnGameModeInit().
Change your format to this.
pawn Код:
format(msg, sizeof(msg), "A new money bag has spawned near %s!", BriefcasePoints[rand][loc]);
You were using the Z position of the pickup rather than the name of the pickups location.
Respuesta: Message when an object spawn [PLS!] -
Nano_UY - 08.02.2011
Unluckily that didn't work, anything else I can try to make it work?
Re: Message when an object spawn [PLS!] -
alpha500delta - 08.02.2011
You could try just
pawn Код:
format(msg, sizeof(msg), "A new money bag has spawned near %s!", loc
Also I've noticed its under OnGameModeInit, noone can see a SendClientMessage under OnGameModeInit (I guess...)
Sorry I'm not good with these things
Respuesta: Message when an object spawn [PLS!] -
Nano_UY - 09.02.2011
Where should I put the format(bla bla bla) then? can u try giving me a bigger part of the script pls?
Re: Message when an object spawn [PLS!] -
Kitten - 09.02.2011
pawn Код:
public OnGameModeInit()
{
new rand = random(sizeof(BriefcasePoints));
mypickup = CreatePickup(1550, 23, BriefcasePoints[rand][locX], BriefcasePoints[rand][locY], BriefcasePoints[rand][locZ]);
new msg[128];
format(msg, sizeof(msg), "A new money bag has spawned near %s!", BriefcasePoints[rand][loc]);
SendClientMessageToAll(0x7E60FFFF, msg);
return 1;
}