 | เพิ่ม
pLifesteal
ใส่ัตัวแปร
new lifesteal[MAX_PLAYERS];
หา
if(FillupDelay < 0)
{
FillupDelay = 0;
}
else
{
FillupDelay -= 1;
}
Enter ลงมาแล้วใส่
if(PlayerInfo[pLifesteal] > 0)
{
lifesteal -= 1;
}
/////////////////////////คำสั่ง////////////////////////////////
if(strcmp(cmd, "/lifesteal", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /lifesteal [playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(PlayerInfo[playerid][pJailed] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "คุณติดคุก");
return 1;
}
if(PlayerInfo[giveplayerid][pJailed] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "เขาอยู่ในคุก");
return 1;
}
if(GetPlayerHealth(giveplayerid) < 20)
{
SendClientMessage(playerid, COLOR_GRAD2, " เลือดเขาน้อยไปที่จะดูด");
return 1;
}
if(lifesteal[playerid] >= 1)
{
format(string, sizeof(string), "* โปรดรออีก %d วินาที",lifesteal[playerid]);
SendClientMessage(playerid, COLOR_GREY,string);
return 1;
}
if(IsPlayerConnected(playerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
if (ProxDetectorS(23.0, playerid, giveplayerid))
{
new life = 10 + random (30);
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, " ไม่ได้ครับห้ามดูดตัวเอง"); return 1; }
format(string, sizeof(string), " ท่านถูก: %s ดูดเลือดไป %d", sendername,life);
SendClientMessage(giveplayerid, COLOR_ALLDEPT, string);
format(string, sizeof(string), "** ท่านดูดเลือดได้ %d **",life);
SendClientMessage(playerid,COLOR_YELLOW,string);
format(string, sizeof(string), "%s: จ๊วบๆ", sendername);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
lifesteal[playerid] = 10;
new Float:health;
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, health + life);
SetPlayerHealth(giveplayerid, health - life);
PlayerInfo[playerid][pLifesteal] = 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " No login");
}
}
}
}
| |