SA-MP Forums Archive
Default Health - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Default Health (/showthread.php?tid=406841)



Default Health - AlexStefan - 11.01.2013

Hello everybody , I have just started to learn scripting in PAWN , and I have a question.
I downloaded a gamemode and I realized that everytime you enter the game , you have only 25% HP , how can I change that? I have the .pwn of the script also.

Thanks.


Re: Default Health - Kudoz - 11.01.2013

Your code please..
OnPlayerSpawn you mayput something like SetPlayerHealth(playerid, 100);


Re: Default Health - AlexStefan - 11.01.2013

Well that's why I aksed without showing the code , because I didn't knew the string name.I will check and test , and let you know if affected.


Re: Default Health - AlexStefan - 11.01.2013

Ok so I added
Quote:

SetPlayerHealth(playerid, 100);

right after the
Quote:

public OnPlayerSpawn(playerid)
{

And didn't worked.Nothing affected.

EDIT: I just saw in console :
Quote:

Warning: PlayerDialogResponse Playerid: 0 dialog ID doesn't match the last sent dialog ID.




Re: Default Health - Kudoz - 11.01.2013

what do you have under OnPlayerSpawn ?


Re: Default Health - AlexStefan - 11.01.2013

public OnPlayerSpawn(playerid)
{
SetPlayerHealth(playerid, 100);
if(IsPlayerNPC(playerid))
{
new npcname[MAX_PLAYER_NAME]; GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "Strip1", true))// Mihai find numele botului
{
SetPlayerSkin(playerid, 256);// skinul botuui
SetPlayerColor(playerid,0xFFFFFF00);// culoare lui
return 1;
}
if(!strcmp(npcname, "Strip2", true))// Mihai find numele botului
{
SetPlayerSkin(playerid, 257);// skinul botuui
SetPlayerColor(playerid,0xFFFFFF00);// culoare lui
return 1;
}
if(!strcmp(npcname, "Barman1", true))// Mihai find numele botului
{
SetPlayerSkin(playerid, 11);// skinul botuui
SetPlayerColor(playerid,0xFFFFFF00);// culoare lui
return 1;
}
}
if(PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 2)
{
undercover[playerid] = 0;
}
insala[playerid] = 0;
DisablePlayerCheckpoint(playerid);
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if(PlayerInfo[playerid][pLocal] == i)
{
DestroyDynamicCP(HouseCP[playerid][PlayerInfo[playerid][pLocal]]);
}
}
PlayerInfo[playerid][pLocal] = 255;
SavePlayerData(playerid);
SetPlayerVirtualWorld(playerid,0);
TextDrawShowForPlayer(playerid, CsArea);
TextDrawShowForPlayer(playerid, Textdraw0);
TextDrawShowForPlayer(playerid, Textdraw1);
TextDrawShowForPlayer(playerid, Textdraw2);
TextDrawShowForPlayer(playerid, Textdraw3);
TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
InitLockDoors(playerid);
STDPlayer[playerid] = 0;
AntiDeAMX();
ShowRXTT(playerid);
gTeam[playerid] = PlayerInfo[playerid][pTeam]; //Set the Team
if(gTeam[playerid] == 3 || gTeam[playerid] == 4)
{
PlayerInfo[playerid][pMember] = 0;
PlayerInfo[playerid][pMember] = 0;
gTeam[playerid] = 3;
}
SetTimerEx("CheckArea",500,1,"i",playerid);
SetTimerEx("Checkjail", 3000, 0, "d", playerid);
SetTimerEx("Checkjail1", 3000, 0, "d", playerid);
SetTimerEx("Checkjail2", 3000, 0, "d", playerid);
GangZoneShowForPlayer(playerid, cripszone, 0x003C7B8;
GangZoneShowForPlayer(playerid, bloods, 0xFF00008E);
GangZoneShowForPlayer(playerid, sianddm, 0x000000BB);
GangZoneShowForPlayer(playerid, surenos, 0x00C3FF7;
GangZoneShowForPlayer(playerid, nortenos, 0xFFB50093);


Re: Default Health - martin3644 - 11.01.2013

We need more info from you. We can not help you otherwise


Re: Default Health - park4bmx - 11.01.2013

Maybe there is timer running seting the health to 25,
Do CTRL + F and look for "GiveaPlayerHealth" and so on.
Until you find your problem.
Also make sure you compile (F5)


Re: Default Health - hydravink - 11.01.2013

If you started learning, then don't steal gamemodes!
Try learning stuff, we can't help you if you are a complete newbie with a GodFather gamemode.


Re: Default Health - AlexStefan - 12.01.2013

Quote:
Originally Posted by hydravink
Посмотреть сообщение
If you started learning, then don't steal gamemodes!
Try learning stuff, we can't help you if you are a complete newbie with a GodFather gamemode.
I don't think it's called "STEALING" while the creator of the GM shared it.
GiveaPlayerHealth - Couldn't find anything.

And yea sure ,just tell me what info do u need.