Vice City Multiplayer

General Discussion => General Discussion => Topic started by: mubdi on August 07, 2013, 12:39:02 pm

Title: can anyone help me plz
Post by: mubdi on August 07, 2013, 12:39:02 pm
hi all i am trying to modify a script so i want to add Tips/hints or other announcements like Tip:Need a weapon type !wep (weaponid/name) and other like these.and dont forget to tell me where to paste it...

sorry i am new
Title: Re: can anyone help me plz
Post by: ysc3839 on August 07, 2013, 12:42:34 pm
SetTimer SendClientMessage
Title: Re: can anyone help me plz
Post by: mubdi on August 07, 2013, 12:47:11 pm
u mean settimer means after how much time to snd the player msg???
Title: Re: can anyone help me plz
Post by: sseebbyy on August 07, 2013, 12:51:34 pm
In this version of VC:MP (0.3zR2) you cannot use TextDraws like in SA:MP, so there will be no small text on your screen without the chat.

Btw, this is the Announce function: http://thijn.vrocker-hosting.co.uk/VCWiki/index.php/GameTextForAll
Title: Re: can anyone help me plz
Post by: mubdi on August 07, 2013, 12:54:03 pm
can u send full coding of it plz
Title: Re: can anyone help me plz
Post by: sseebbyy on August 07, 2013, 01:16:34 pm
Add this at OnPlayerJoin:

Code: [Select]
GameTextForAll("my hint will be typed here");
Title: Re: can anyone help me plz
Post by: mubdi on August 07, 2013, 01:21:48 pm
ok,but it will only come on joining i think
Title: Re: can anyone help me plz
Post by: sseebbyy on August 07, 2013, 03:34:06 pm
ok,but it will only come on joining i think

Exactly. If you want to show messages at an interval of time, you have to use SetTimer function.
Add SetTimer onGameModeInit, and create the function that is called by the timer, and in it add the GameTextForAll function with your message.
Title: Re: can anyone help me plz
Post by: mubdi on August 07, 2013, 10:29:59 pm
can u send me the coding so that the message will come at an interval of time
Title: Re: can anyone help me plz
Post by: sseebbyy on August 07, 2013, 11:01:46 pm
can u send me the coding so that the message will come at an interval of time

It has to be something like this:

First of all, we need the timer that has to start OnGameModeInit:
(the timer will call the function named "HintSystem" created by us)
Code: [Select]
SetTimer("HintSystem", 60000, 0);
60000 = 1 minute.
1000 = 1 second.

After that, we have to create the function that will be called by the timer:
Code: [Select]
public HintSystem()
{
     GameTextForAll("My  hint will be typed here");
}
Title: Re: can anyone help me plz
Post by: mubdi on August 07, 2013, 11:26:28 pm
i dont know in which file we have to paste this and how to paste it



sorry that i wasted ur time u are very good member u help all
Title: Re: can anyone help me plz
Post by: sseebbyy on August 08, 2013, 12:37:00 am
Into the "gamemodes" directory of your Windows Server you will find "mode.pwn".
You have to open it with VC:MP Pawno, paste the script where I told you and compile it by clicking on the [>] button
Title: Re: can anyone help me plz
Post by: cchstore on August 20, 2013, 06:29:23 pm
u mean settimer means after how much time to snd the player msg???
Title: Re: can anyone help me plz
Post by: USA.Ghost on August 21, 2013, 12:15:57 pm
at the top of your gamemode:
new funct;
to OnGameModeInit
[pawn]public OnGameModeInit()
{
SetTimer("mymessages", 60000, 1);
return 1;
}[/pawn]
add this public func
[pawn]public mymessages()
{
if(funct == 0){ SendClientMessageToAll(0x04A36BFF, "TIP: tip 1 here"); funct++;}
if(funct == 1){ SendClientMessageToAll(0x04A36BFF, "TIP: tip 2 here"); funct++;}
if(funct == 2){ SendClientMessageToAll(0x04A36BFF, "TIP: tip 3 here"); funct++;}
if(funct == 3){ SendClientMessageToAll(0x04A36BFF, "TIP: tip 4 here"); funct++;}
if(funct == 4){ SendClientMessageToAll(0x04A36BFF, "TIP: tip 5 here"); funct++;}
if(funct == 5){ SendClientMessageToAll(0x04A36BFF, "TIP: tip 6 here"); funct = 0;}

}[/pawn]

you need pawno to compile it
replace tip - here with your tip
if it doesnt work tell me
it gives one tip every minute
replace TIP: with HINT: to give a hint