- เครดิต
- 168
- ความรู้
-
- เงิน $
-
- ความดี
-
|
if(strcmp(cmd, "/headvalue", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new gun;
gun = strval(tmp);
if(PlayerInfo[playerid][pAdminLevel] <= 2)
{
SendClientMessage(playerid, COLOR_GREY, " you are not authorized to use that command!");
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /headvalue [playerid/PartOfName] [gun] [moneys]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /headvalue [playerid/PartOfName] [gun] [moneys]");
return 1;
}
gun = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /headvalue [playerid/PartOfName] [gun] [moneys]");
return 1;
}
if(gun < 1 || gun > 46) { SendClientMessage(playerid, COLOR_GREY, "เลขอาวุธมีแค่ 1-46 เท่านั้น"); return 1; }
new amount;
amount = strval(tmp);
if(amount < 1 || amount > 10000000) { SendClientMessage(playerid, COLOR_GREY, "จำนวนเงินต้องมากกว่า $1 และไม่มากกว่า $10,000,000!"); return 1; }
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, " คุณไม่สามารถจ้างฆ่าตัวเองได้"); return 1; }
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[giveplayerid][pKillMoney] += amount;
PlayerInfo[giveplayerid][pKillWeapon] = gun;
SetPlayerColor(giveplayerid, 0xFF0000FF);
format(string, sizeof(string), "[ข่าวสารกิจกรรม]ค่าหัวของ %s ถูกเพิ่มเป็น $%d คุณต้องใช่อาวุธ %s ในการสังหารเท่านั้น",giveplayer, PlayerInfo[giveplayerid][pKillMoney], Weapons[gun]);
SendClientMessageToAll(COLOR_YELLOW, string);
}
}
else
{
format(string, sizeof(string), " %d ผู้เล่นนั้นไม่ได้อยู่ในเกมส์ครับ", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}if(strcmp(cmd, "/headvalue", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new gun;
gun = strval(tmp);
if(PlayerInfo[playerid][pAdminLevel] <= 2)
{
SendClientMessage(playerid, COLOR_GREY, " you are not authorized to use that command!");
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /headvalue [playerid/PartOfName] [gun] [moneys]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /headvalue [playerid/PartOfName] [gun] [moneys]");
return 1;
}
gun = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /headvalue [playerid/PartOfName] [gun] [moneys]");
return 1;
}
if(gun < 1 || gun > 46) { SendClientMessage(playerid, COLOR_GREY, "เลขอาวุธมีแค่ 1-46 เท่านั้น"); return 1; }
new amount;
amount = strval(tmp);
if(amount < 1 || amount > 10000000) { SendClientMessage(playerid, COLOR_GREY, "จำนวนเงินต้องมากกว่า $1 และไม่มากกว่า $10,000,000!"); return 1; }
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, " คุณไม่สามารถจ้างฆ่าตัวเองได้"); return 1; }
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[giveplayerid][pKillMoney] += amount;
PlayerInfo[giveplayerid][pKillWeapon] = gun;
SetPlayerColor(giveplayerid, 0xFF0000FF);
format(string, sizeof(string), "[ข่าวสารกิจกรรม]ค่าหัวของ %s ถูกเพิ่มเป็น $%d คุณต้องใช่อาวุธ %s ในการสังหารเท่านั้น",giveplayer, PlayerInfo[giveplayerid][pKillMoney], Weapons[gun]);
SendClientMessageToAll(COLOR_YELLOW, string);
}
}
else
{
format(string, sizeof(string), " %d ผู้เล่นนั้นไม่ได้อยู่ในเกมส์ครับ", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
} |
|