need example
#1

i download progress bar creater and i create progress bar and i found this code by export my project
but i dont know how to run this bar when player connect to the server plz tell me how to use this.

Quote:

#include <a_samp>
#include <progress2>

new PlayerBar:Bar0[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
Bar0[playerid] = CreatePlayerProgressBar(playerid, 18.000000, 323.000000, 133.000000, 3.200000, -1429936641, 100.0000, 0);

return 1;
}

public OnPlayerSpawn(playerid)
{
ShowPlayerProgressBar(playerid, Bar0[playerid]);

return 1;
}

Reply
#2

Uhm.. Well, it already says where you should put those... I mean...

put this in includes;

pawn Код:
#include <progress2>
put this on top of your script, below includes;

pawn Код:
new PlayerBar:Bar0[MAX_PLAYERS];
Then, hit CTRL+F, type OnPlayerConnect and paste this beneath the bracket;
pawn Код:
Bar0[playerid] = CreatePlayerProgressBar(playerid, 18.000000, 323.000000, 133.000000, 3.200000, -1429936641, 100.0000, 0);
Then, hit CTRL+F again, type OnPlayerSpawn and paste this beneath the bracket;
pawn Код:
ShowPlayerProgressBar(playerid, Bar0[playerid]);
It isn't really that complicated, please do some research about scripting.
Reply
#3

i know this but how attach this bar with health or etc
Reply
#4

Quote:
Originally Posted by LovelySoomro
Посмотреть сообщение
i know this but how attach this bar with health or etc
I am afraid no-one will help you on that one, people don't give codes away here. You can seek for a scripter, I am sure there are topics strictly for looking for staff members. I am sure your answer is somewhere throughout the forums, make some searches and you should find what you are looking for.
Reply
#5

bro how attach this bar when players connect bar come and load then register or login dialog come

Quote:

public OnPlayerConnect(playerid)
{
TogglePlayerSpectating(playerid, 1);
SetTimerEx("ProgrecoBar",pSpeed,false,"i",playerid );
return 1;
}
public ProgrecoBar(playerid)
{
if(dUserINT(PlayerName2(playerid)).("Registered") == 0)
{
SendClientMessage(playerid,LIGHTBLUE,"[NGP]: {fffafa}This Account isn't registered,Plz Type {00bfff}Pass {ffffff}To Register Your Account.");
new rs2tring[256];
format(rs2tring,256,"{00fa9a}Register Account: {7fff00}%s\n{ffff00}Enter The pass to Register your Account:",pName(playerid));
ShowPlayerDialog(playerid,DIALOGID+66,DIALOG_STYLE _INPUT,"Register",rs2tring,"Register","Quit");
}
if(dUserINT(PlayerName2(playerid)).("Registered") == 1)
{
SendClientMessage(playerid,LIGHTBLUE, "[NGP]: {fffafa}This Account is registered Plz type {00bfff}Pass {ffffff}to logged In.");
new lstring[256];
format(lstring,256,"{00fa9a}Login Account: {7fff00}%s\n{ffff00}Plz Enter Your Password To Load Your Stats:",pName(playerid));
ShowPlayerDialog(playerid,DIALOGID+67,DIALOG_STYLE _INPUT,"Login",lstring,"Login","Quit");
}
return 1;
}

Reply
#6

this should do the job xd after taking a look on : https://sampforum.blast.hk/showthread.php?tid=113443
I learned this :c : >

PHP код:
new Bar:health1[MAX_PLAYERS],hptime[MAX_PLAYERS],firstcheck[MAX_PLAYERS];
public 
OnPlayerConnect(playeridfirstcheck[playerid] = 0;
public 
OnPlayerSpawn(playerid) {
   if(
firstcheck[playerid] == 0) { hptime[playerid] = SetTimerEx("HPTime",1000,1,"i",playerid); firstcheck[playerid] = 1; }
}
public 
OnPlayerDisConnect(playerid,reason) if(firstcheck[playerid] == 1KillTimer(hptime[playerid]);
forward HPTime(playerid);
public 
HPTime(playerid) {
   
health1[playerid] = CreateProgressBar(xy__0xFF0000FF100.0);
   new 
Float:health;
   
GetPlayerHealth(playerid,health);
   if(
health 100health 100;
   
SetProgressBarValue(health1[playerid], health);
   
ShowProgressBarForPlayer(playeridhealth1[playerid]);

Reply
#7

ah thank you so much bro now i understand this rep +
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)