Message when an object spawn [PLS!]
#1

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.
Reply
#2

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.
Reply
#3

Unluckily that didn't work, anything else I can try to make it work?
Reply
#4

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
Reply
#5

Where should I put the format(bla bla bla) then? can u try giving me a bigger part of the script pls?
Reply
#6

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)