#include <a_samp>
new Float:health;
forward for20hp(playerid);
public for20hp(playerid)
{
if(GetPlayerHealth(playerid,health) >= 20)
{
ApplyAnimation(playerid,\"CRACK\",\"crckdeth2\",4.1,1,1,1,1,1);
}
return 1;
}
public OnFilterScriptInit() { return SetTimer(\"for20hp\", 1000, 1); }
public OnPlayerCommandText(playerid, cmdtext[])
{
new giveplayerid, idx;
new tmp[256];
new cmd[256];
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, \"/segit\",true) == 0)
{
if (giveplayerid == playerid)
{
SendClientMessage(playerid, 0xFFFF00AA, \"Magadat nem segítheted fel.\");
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFFFFFFAA, \"HASZNÁLD: /segit [playerid]\");
return 1;
}
giveplayerid = strval(tmp);
if(IsPlayerConnected(giveplayerid))
{
SetPlayerHealth(giveplayerid,30);
ClearAnimations(giveplayerid);
SendClientMessage(playerid, 0xFFFFFFAA, \"Felsegítetted a játékost.\");
SendClientMessage(giveplayerid, 0xFFFFFFAA, \"Menj, gyorsan tölsd fel az életed!\");
return 1;
}
else
{
SendClientMessage(playerid, 0xFFFFFFAA, \"Nincs ilyen ID!\");
}
return 1;
}
return 0;
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= \' \'))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > \' \') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
Sajnos nemesik animba 20hp alatt!És szeretnék egy ojat kérni amibe hogyha nekimész a falnak akkor lemegy a hpd. Köszönm
return result;
}