FAQS # 1 -
dadadaamy - 21.07.2012
Hi all , this is my first tutorial so don't curse me xD .
Question #1:
How can i activate chat bubble ?
Answer:
Simple ! We go on this :
Код:
public OnPlayerText(playerid, text[])
{
And we add this :
Код:
SetPlayerChatBubble(playerid, text, 0xFF0000FF, 100.0, 10000);
It will look something like this :
Код:
public OnPlayerText(playerid, text[])
{
SetPlayerChatBubble(playerid, text, 0xFF0000FF, 100.0, 10000);
return 1;
}
What means the words between
( );
playerid - player's id
Text- What the player types/writes in chat
0xFF0000FF - The color . Pick another one at :
www.colorpicker.com
100.0 - The distance which other player can see the chatbubble from the player
10000- The time that bubbles appears .
I hope you got it .
Source :
https://sampwiki.blast.hk/wiki/SetPlayerChatBubble
Question 2# :
How can i make a textdraw ?
Answer:
It's a textdraw editor , which you can modify :
-the dimension
-Color
-Position
-textdraw shadow
-Outline
Link:
http://forum.sa-mp.com/showthread.ph...tdraweditor1.0
Credits: Zamaroht
Question 3# :
How can i make that when a player spawn , it gives him something ?
Simple...
Search : OnPlayerSpawn
Код:
public OnPlayerSpawn(playerid)
{
return 1;
}
Add what you want to add :
Money -> GivePlayerMoney(playerid,amount);
Score -> SetPlayerScore(playeri,GetPlayerScore(playerid) + AMOUNT );
Armour -> SetPlayerArmour(playerid,100);
Sources :
https://sampwiki.blast.hk/wiki/SetPlayerArmour
https://sampwiki.blast.hk/wiki/SetPlayerScore
https://sampwiki.blast.hk/wiki/GetPlayerScore
https://sampwiki.blast.hk/wiki/GivePlayerMoney
Question 4# :
How can i make that , when a player kills another player , the killer gets a message?
Raspuns:
Search on :
Код:
public OnPlayerDeath)playerid, killerid, reason);
{
return 1;
}
And we add this :
GameTextForPlayer(playerid,"~b~You killed someone",6000,3);
It will look something like this :
Код:
public OnPlayerDeath)playerid, killerid, reason);
{
GameTextForPlayer(killerid,"~b~ai murit",6000,3);
return 1;
}
What means every word between ( and ) :
killerid - The killer's id
"~b~you're dead "- the text ~b~ -> the color . ~b~ = blue , ~y~ = yellow , etc .
6000- time
3- style
If we want to give money to the killer
GivePlayerMoney(killerid, BANI ); Ex : GivePlayerMoney(killerid, 1000 );
It will look something like this :
Код:
public OnPlayerDeath)playerid, killerid, reason);
{
GameTextForPlayer(playerid,"~b~ai murit",6000,3);
GivePlayerMoney(killerid, 1000 );
return 1;
}
I hope you got it .
You can give score to the killah :
SetPlayerScore(killerid, GetPlayerScore(killerid) + 20);
Health :
SetPlayerHealth(killerid, 100);
Armour:
SetPlayerArmour(killerid, 100);
Surse:
https://sampwiki.blast.hk/wiki/SetPlayerArmour
https://sampwiki.blast.hk/wiki/SetPlayerScore
https://sampwiki.blast.hk/wiki/GetPlayerScore
https://sampwiki.blast.hk/wiki/GivePlayerMoney
https://sampwiki.blast.hk/wiki/OnPlayerDeath
https://sampwiki.blast.hk/wiki/GameTextForPlayer
Question 5# :
How can i enable deathmessages ? Like this
[img width=500 height=375]/imageshack/img854/9492/ngkr3dcg5p2uipq7xjpl.png[/img]
?
Raspuns:
Simple !
Search on :
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
We add this :
SendDeathMessage(killerid, playerid, reason);
It will look something like this :
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
return 1;
}
That's what i teached you today .
Give me respect , and i will make another tutorial .
Peace !
Credits:
me ( dadadamy )
https://sampwiki.blast.hk/wiki/Main_Page
Zamaroht
Thanks alot !
Re: FAQS # 1 -
seanny - 21.07.2012
Pretty nice!