- เครดิต
- 168
- ความรู้
-
- เงิน $
-
- ความดี
-
|
if(strcmp(cmd, "/ob", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pHp] <=0)
{
SendClientMessage(playerid, COLOR_LIGHTRED, " ไม่มีกล่อง");
return 1;
}
if(PlayerInfo[playerid][pLevel] >= 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new randsmoke = random(100)+1;
if(randsmoke >= 1 && randsmoke <= 99)
{
new box = 5000 + random (8000);
GetPlayerName(playerid, sendername, sizeof(sendername));
SafeGivePlayerMoney(playerid, box);
//PlayerInfo[playerid][pFire] -= 1;
format(string,sizeof(string), "* %s เปิดกล่องแล้วหยิบเงินมานับ", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
format(string, sizeof(string), "** %s ได้หยิบเงินออกมาจากกล่องได้เงินมา $%d", sendername,box);
SendClientMessageToAll(0x61F600AA, string);
PlayerInfo[playerid][pHp] -= 1;
return 1;
}
if(randsmoke == 100)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new box2 = 100000 + random (1000000);
SafeGivePlayerMoney(playerid, box2);
//PlayerInfo[playerid][pFire] -= 1;
ClearChatbox(playerid, 500);
format(string,sizeof(string), "* %s เปิดกล่องแล้วหยิบเงินมานับ", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
format(string, sizeof(string), "** %s ได้หยิบเงินออกมาจากกล่องได้เงินมา $%d ", sendername,box2);
SendClientMessageToAll(COLOR_YELLOW2, string);
new Float:boomx, Float:boomy, Float:boomz;
GetPlayerPos(giveplayerid,boomx, boomy, boomz);
CreateExplosion(boomx, boomy , boomz, 7, 10);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pHp] -= 1;
return 1;
}
}
}
return 1;
} |
|