Vice City Multiplayer
General Discussion => General Discussion => Topic started 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
-
SetTimer SendClientMessage
-
u mean settimer means after how much time to snd the player msg???
-
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
-
can u send full coding of it plz
-
Add this at OnPlayerJoin:
GameTextForAll("my hint will be typed here");
-
ok,but it will only come on joining i think
-
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.
-
can u send me the coding so that the message will come at an interval of time
-
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)
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:
public HintSystem()
{
GameTextForAll("My hint will be typed here");
}
-
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
-
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
-
u mean settimer means after how much time to snd the player msg???
-
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