08.07.2015, 13:42
PHP код:
while(DrugsTaken[playerid] < 5)
{
format(string, sizeof(string), "You Have Taken %d Grams of Drugs. Your Health Will Refill Automatically.", amount);
SendClientMessage(playerid,GREEN, string);
format(string, sizeof(string), "Remaining Drugs: %d",pData[playerid][pDrugs]);
SendClientMessage(playerid,GREEN, string);
GameTextForPlayer(playerid,"~w~ON DRUGS",5000,3);
SetPlayerChatBubble(playerid, "On Drugs", COLOR_YELLOW, 100.0, 5000);
SetPlayerDrunkLevel(playerid, 4999);
return 1;
}
while(DrugsTaken[playerid] < 10)
{
format(string, sizeof(string), "You Have1 Taken %d Grams of Drugs. Your Health Will Refill Automatically.", amount);
SendClientMessage(playerid,GREEN, string);
format(string, sizeof(string), "Remaining Drugs: %d",pData[playerid][pDrugs]);
SendClientMessage(playerid,GREEN, string);
GameTextForPlayer(playerid,"~w~ON DRUGS",5000,3);
SetPlayerChatBubble(playerid, "On Drugs", COLOR_YELLOW, 100.0, 5000);
SetPlayerDrunkLevel(playerid, 5999);
return 1;
}
while(DrugsTaken[playerid] < 20)
{
format(string, sizeof(string), "You Have2 Taken %d Grams of Drugs. Your Health Will Refill Automatically.", amount);
SendClientMessage(playerid,GREEN, string);
format(string, sizeof(string), "Remaining Drugs: %d",pData[playerid][pDrugs]);
SendClientMessage(playerid,GREEN, string);
GameTextForPlayer(playerid,"~w~ON DRUGS",5000,3);
SetPlayerChatBubble(playerid, "On Drugs", COLOR_YELLOW, 100.0, 5000);
SetPlayerDrunkLevel(playerid, 6999);
return 1;
}
while(DrugsTaken[playerid] < 25)
{
format(string, sizeof(string), "You Have3 Taken %d Grams of Drugs. Your Health Will Refill Automatically.", amount);
SendClientMessage(playerid,GREEN, string);
format(string, sizeof(string), "Remaining Drugs: %d",pData[playerid][pDrugs]);
SendClientMessage(playerid,GREEN, string);
GameTextForPlayer(playerid,"~w~ON DRUGS",5000,3);
SetPlayerChatBubble(playerid, "On Drugs", COLOR_YELLOW, 100.0, 5000);
SetPlayerDrunkLevel(playerid, 7999);
return 1;
}
I mean it applys to this
PHP код:
while(DrugsTaken[playerid] < 5)
{
format(string, sizeof(string), "You Have Taken %d Grams of Drugs. Your Health Will Refill Automatically.", amount);
SendClientMessage(playerid,GREEN, string);
format(string, sizeof(string), "Remaining Drugs: %d",pData[playerid][pDrugs]);
SendClientMessage(playerid,GREEN, string);
GameTextForPlayer(playerid,"~w~ON DRUGS",5000,3);
SetPlayerChatBubble(playerid, "On Drugs", COLOR_YELLOW, 100.0, 5000);
SetPlayerDrunkLevel(playerid, 4999);
return 1;
}
PHP код:
COMMAND:takedrugs(playerid, params[])
{
new amount,string[256];
if(sscanf(params, "d", amount))
{
if(pData[playerid][pDrugs] >= 10)
{
DrugsTaken[playerid] += 10;
pData[playerid][pDrugs] -= 10;
pData[playerid][pDrugsTime] = 10*8;
while(DrugsTaken[playerid] > 60)
{
pData[playerid][pCustomDeath] = WEAPON_OVERDOSE;
SendDeathMessage(INVALID_PLAYER_ID, playerid, 47);
GameTextForPlayer(playerid,"~r~Drug Overdose",5000,3);
SetPlayerHealth(playerid,0);
DrugsTaken[playerid] = 0;
return 1;
}
SendClientMessage(playerid,GREEN, "You Have Taken 10 Grams of Drugs. Your Health Will Refill Automatically.");
format(string, sizeof(string), "Remaining Drugs: %d",pData[playerid][pDrugs]);
SendClientMessage(playerid,GREEN, string);
GameTextForPlayer(playerid,"~w~ON DRUGS",5000,3);
SetPlayerChatBubble(playerid, "On Drugs", COLOR_YELLOW, 100.0, 5000);
SetPlayerDrunkLevel(playerid, 4999);
ON_DRUGS[playerid]=1;
GivePlayerHealth(playerid, 12);
}
else
{
SendClientMessage(playerid, RED, "You Don't have Any Amount Of Drugs.");
}
return 1;
}
if(amount < 1)
{
SendClientMessage(playerid, RED,"Invalid Amount - Take Atleast 1g.");
return 1;
}
if (amount > pData[playerid][pDrugs])
{
format(string, sizeof(string), "You Do Not Have Enough Drugs. You Are Carrying %d Grams Of Drugs.",pData[playerid][pDrugs]);
SendClientMessage(playerid,RED, string);
return 1;
}
DrugsTaken[playerid] += amount;
pData[playerid][pDrugs] -= amount;
pData[playerid][pDrugsTime] = amount*8;
if(DrugsTaken[playerid] > 60)
{
pData[playerid][pCustomDeath] = WEAPON_OVERDOSE;
SendDeathMessage(INVALID_PLAYER_ID, playerid, 47);
GameTextForPlayer(playerid,"~r~Drug Overdose",5000,3);
SetPlayerHealth(playerid,0);
DrugsTaken[playerid] = 0;
return 1;
}
while(DrugsTaken[playerid] < 5)
{
format(string, sizeof(string), "You Have Taken %d Grams of Drugs. Your Health Will Refill Automatically.", amount);
SendClientMessage(playerid,GREEN, string);
format(string, sizeof(string), "Remaining Drugs: %d",pData[playerid][pDrugs]);
SendClientMessage(playerid,GREEN, string);
GameTextForPlayer(playerid,"~w~ON DRUGS",5000,3);
SetPlayerChatBubble(playerid, "On Drugs", COLOR_YELLOW, 100.0, 5000);
SetPlayerDrunkLevel(playerid, 4999);
return 1;
}
while(DrugsTaken[playerid] < 10)
{
format(string, sizeof(string), "You Have1 Taken %d Grams of Drugs. Your Health Will Refill Automatically.", amount);
SendClientMessage(playerid,GREEN, string);
format(string, sizeof(string), "Remaining Drugs: %d",pData[playerid][pDrugs]);
SendClientMessage(playerid,GREEN, string);
GameTextForPlayer(playerid,"~w~ON DRUGS",5000,3);
SetPlayerChatBubble(playerid, "On Drugs", COLOR_YELLOW, 100.0, 5000);
SetPlayerDrunkLevel(playerid, 5999);
return 1;
}
while(DrugsTaken[playerid] < 20)
{
format(string, sizeof(string), "You Have2 Taken %d Grams of Drugs. Your Health Will Refill Automatically.", amount);
SendClientMessage(playerid,GREEN, string);
format(string, sizeof(string), "Remaining Drugs: %d",pData[playerid][pDrugs]);
SendClientMessage(playerid,GREEN, string);
GameTextForPlayer(playerid,"~w~ON DRUGS",5000,3);
SetPlayerChatBubble(playerid, "On Drugs", COLOR_YELLOW, 100.0, 5000);
SetPlayerDrunkLevel(playerid, 6999);
return 1;
}
while(DrugsTaken[playerid] < 25)
{
format(string, sizeof(string), "You Have3 Taken %d Grams of Drugs. Your Health Will Refill Automatically.", amount);
SendClientMessage(playerid,GREEN, string);
format(string, sizeof(string), "Remaining Drugs: %d",pData[playerid][pDrugs]);
SendClientMessage(playerid,GREEN, string);
GameTextForPlayer(playerid,"~w~ON DRUGS",5000,3);
SetPlayerChatBubble(playerid, "On Drugs", COLOR_YELLOW, 100.0, 5000);
SetPlayerDrunkLevel(playerid, 7999);
return 1;
}
return 1;
}