2 questions any help please :) -
Bulgaria - 03.04.2015
Hello best homies i want to ask 2 questions:
1: How to make system when player loose low of 50 % health i want camera start mooving like he is drunk and when player loose lo of 20% Health i want to get some of crack animations and i want som ambulance command to use when go to player and type /healthplayer the Vet start animation like he is plant a bomb and player who lose health to get another 100% health maybe is not hard but i dont know how to make it i'm newbie in scripting soo please understand me
2: How to set player password - i mean when player select menu someone player want to play with my skyn (admin skin) i want to pop up a window and type password to get skin and play if is possible of course
Thanks in advance i'm sorry if you lose your time for me but like a said im newbie in scripting and i learn now
Happy day
Re: 2 questions any help please :) -
Bulgaria - 03.04.2015
Please HELP ME :/
Re: 2 questions any help please :) -
ImperioHosting - 03.04.2015
PHP код:
#include <a_samp>
//news dos textdraws
new Text:Textdraw0;
new hourtwohaha, minutetwohaha;
new Text:HealthBar[MAX_PLAYERS];
new Text:ArmourBar[MAX_PLAYERS];
new Text:TextDrawDetorn;
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
AddPlayerClass(280,1594.3829,-1675.4155,5.8906,265.8557,23,9999999,25,9999999,31,9999999); //policia militar
SetTimer("AtualizarBars",1000,true);
return 1;
}
public OnPlayerConnect(playerid)
{
HealthBar[playerid] = TextDrawCreate(548.000000, 66.000000, "100");
TextDrawBackgroundColor(HealthBar[playerid], 255);
TextDrawFont(HealthBar[playerid], 1);
TextDrawLetterSize(HealthBar[playerid], 0.280000, 1.000000);
TextDrawColor(HealthBar[playerid], -1);
TextDrawSetOutline(HealthBar[playerid], 1);
TextDrawSetProportional(HealthBar[playerid], 1);
ArmourBar[playerid] = TextDrawCreate(548.000000, 43.000000, "100");
TextDrawBackgroundColor(ArmourBar[playerid], 255);
TextDrawFont(ArmourBar[playerid], 1);
TextDrawLetterSize(ArmourBar[playerid], 0.290000, 1.100000);
TextDrawColor(ArmourBar[playerid], -1);
TextDrawSetOutline(ArmourBar[playerid], 1);
TextDrawSetProportional(ArmourBar[playerid], 1);
Textdraw0 = TextDrawCreate(532.000000, 405.000000, "ELEMENT OFICIAL");
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 1);
TextDrawLetterSize(Textdraw0, 0.359998, 2.099998);
TextDrawColor(Textdraw0, -7601921);
TextDrawSetOutline(Textdraw0, 1);
TextDrawSetProportional(Textdraw0, 1);
return 1;
}
public OnPlayerSpawn(playerid)
{
TextDrawShowForPlayer(playerid, TextDrawDetorn);
return 1;
}
forward AtualizarBars();
public AtualizarBars()
{
for(new playerid; playerid<GetMaxPlayers(); playerid++)
{
if(IsPlayerConnected(playerid))
{
new Float:Health;
new HealthString[15];
GetPlayerHealth(playerid,Health);
format(HealthString, 15, " %d",floatround(Health));
TextDrawSetString(HealthBar[playerid],HealthString);
TextDrawShowForPlayer(playerid,HealthBar[playerid]);
new Float:Armour;
GetPlayerArmour(playerid,Armour);
if(Armour > 0)
{
new ArmourString[15];
format(ArmourString, 15, " %d",floatround(Armour));
TextDrawSetString(ArmourBar[playerid],ArmourString);
TextDrawShowForPlayer(playerid,ArmourBar[playerid]);
}
return 1;
}
This meets his first requests
Please reputation
Re: 2 questions any help please :) -
Bulgaria - 03.04.2015
When i read this i dont think is that what i search
Re: 2 questions any help please :) -
CalvinC - 04.04.2015
Go to the tutorials section or search.
This is for help, not learning everything, it's clearly documented on the wiki and tutorials how to do these certain things, just take it 1 step at a time.
Like make the player drunk:
https://www.******.dk/search?q=samp%20drunk
Re: 2 questions any help please :) -
Bulgaria - 04.04.2015
It's easy for you... but for me is very hard...
AW: 2 questions any help please :) -
Mencent - 04.04.2015
Where do you not come on? Post your codes here, so we look about that.
Mencent
Re: 2 questions any help please :) -
CalvinC - 04.04.2015
With the first one, start off by setting a repeating timer under OnGameModeInit, using:
https://sampwiki.blast.hk/wiki/SetTimer
Код:
SetTimer("1SecTimer", 1000, true);
/*
1SecTimer - The public we're gonna call
1000 - The time it will take before we call the public in milliseconds, we'll set it to 1 second
true - Should it repeat, in this case we want to check his health each second, so true, it should repeat
*/
Then in the public, loop through all players
https://sampwiki.blast.hk/wiki/Keywords:Statements#for
Код:
for(new i = 0; i < MAX_PLAYERS; i ++) // Calls the code underneath 500 times as "i"
{
if(IsPlayerConnected(i)) // Check if that number is connected
{
}
}
Or just use foreach
And check if their health is below etc. 50
https://sampwiki.blast.hk/wiki/GetPlayerHealth
Код:
new
Float: HP // Declare "HP" as a float (a number that can hold decimals, like 21.1582)
;
GetPlayerHealth(i, HP); // Stores the players health in the HP float
if(HP < 50) // If the HP float is set to something lower than 50
{
}
And then set their drunk level.
https://sampwiki.blast.hk/wiki/SetPlayerDrunkLevel
Код:
if(HP < 50)
{
SetPlayerDrunkLevel(i, 2000);
}
Re: 2 questions any help please :) -
Bulgaria - 04.04.2015
can you get the code everything in one to i see exacutly how look this because is little maze for me
Re: 2 questions any help please :) -
Bulgaria - 04.04.2015
OK Lets start it
Here is my 3 medics ped
PHP код:
AddPlayerClass(274,1176.4547,-1323.8755,14.0221,269.8242,0,0,0,0,0,0); // Driver Medic
AddPlayerClass(70,1176.9865,-1323.8557,14.0484,269.9431,0,0,0,0,0,0); // Doctor
AddPlayerClass(276,1177.7422,-1323.2667,14.0857,270.5919,0,0,0,0,0,0); // Driver2
Okay we need only DOCTOR make command /healthplayer but we need to create they a team
to only DOCTOR make use this command and here is the name of ANIM who i want to do Doctor when health player
PHP код:
BOM_Plant_Crouch_In
So and this is the anim who i want when player lose more than 50 % of his HP
PHP код:
Sweet_injuredloop PLUS Drunk Camera
And here is the anim who i want to player make when he lose than 80% of his health
Soo that's all now i need someone who know how to make the command and team