This is utterly confusing....How can this be?
#2

pawn Код:
CMD:usedrug(playerid, params[])
{
    if(LoggedIn[playerid] == 0)return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
    if(Cocaine[playerid] && Weed[playerid] == 0)return SendClientMessage(playerid, COLOUR_GREY, "You do not have any drugs to use.");
    new usage[24], string[128];
    if(sscanf(params, "s[24]", usage)) return SendClientMessage(playerid, COLOUR_GREY, "USAGE: /usedrug [drug] - Drug types: weed, coke.");
   
    if(!strcmp(usage, "coke", true))
        {
            if(IsDrugged[playerid] == 1) return SendClientMessage(playerid, COLOUR_GREY, "You are already using drugs.");
            SetPlayerWeather(playerid, 39);
            SetPlayerDrunkLevel(playerid, 3000);
            Cocaine[playerid] = Cocaine[playerid] - 1;
            DrugUsed[playerid] = 1;
            IsDrugged[playerid] = 1;
            DruggedTime[playerid] = 45;
            PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
            MySQL_SetInteger(PlayerSQLID[playerid], "Cocaine", Cocaine[playerid], "accounts");
            SetTimer("DruggedTimer", 1000, 1);
            format(string, sizeof(string), "You have taken 1 gram of cocaine, you will recieve an armour boost after the effects wear off.");
            SendClientMessage(playerid, COLOUR_WHITE, string);
            }
    if(!strcmp(usage, "weed", true))
        {
            if(IsDrugged[playerid] == 1) return SendClientMessage(playerid, COLOUR_GREY, "You are already using drugs.");
            SetPlayerWeather(playerid, 20);
            SetPlayerDrunkLevel(playerid, 3000);
            Weed[playerid] = Weed[playerid] - 1;
            DrugUsed[playerid] = 2;
            DruggedTime[playerid] = 45;
            PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
            MySQL_SetInteger(PlayerSQLID[playerid], "Weed", Weed[playerid], "accounts");
            SetTimer("DruggedTimer", 1000, 1);
            format(string, sizeof(string), "You have taken 1 gram of weed, you will recieve a health boost after the effects wear off.");
            SendClientMessage(playerid, COLOUR_WHITE, string);
       

        }
    return 1;
}
You must add ! before the strcmp
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)