[FIXED] /usedrugs
#1

Problem fixed

Thanks to Pandabeer1337
Reply
#2

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.
Reply
#3

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)