SA-MP Forums Archive
[FIXED] /usedrugs - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [FIXED] /usedrugs (/showthread.php?tid=75392)



[FIXED] /usedrugs - ArTisT - 01.05.2009

Problem fixed

Thanks to Pandabeer1337



Re: [HELP] /usedrugs - Think - 01.05.2009

Quote:
Originally Posted by ArTisT
Quote:

if(strcmp(cmdtext, "/usedrugs", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pDrugs] > 1)
{
new Float:health;
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, health + 10.0);
SendClientMessage(playerid, COLOR_GREY, " 2 Drug Grams used !");
PlayerInfo[playerid][pDrugs] -= 2;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You dont have any Drug Grams left !");
}
return 1;
}

The problem is it dont shows the message " You dont have any Drug Grams left !" when somebody have 0 drugs
pawn Код:
if(strcmp(cmdtext, "/usedrugs", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pDrugs] > 1)
{
new Float:health;
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, health + 10.0);
SendClientMessage(playerid, COLOR_GREY, " 2 Drug Grams used !");
PlayerInfo[playerid][pDrugs] -= 2;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You dont have any Drug Grams left !");
}
return 1;
}
this should fix it, you had the else @ IsPlayerConnected.


Re: [FIXED] /usedrugs - Khelif - 01.05.2009

Код:
if(IsPlayerConnected(playerid))
is useless I think


Re: [FIXED] /usedrugs - Think - 01.05.2009

Quote:
Originally Posted by Khelif
Код:
if(IsPlayerConnected(playerid))
is useless I think
it is, but w/e