SA-MP Forums Archive
[HELP]Deposit drugs - 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: [HELP]Deposit drugs (/showthread.php?tid=196701)



[HELP]Deposit drugs - [Aka]Dragonu - 06.12.2010

I made a command :
pawn Код:
if(strcmp(cmd, "/depositdrugs", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_GREY, "USAGE: /deposit [amount]");
            return 1;
        }
        giveplayerid = strval(tmp);
        if (PlayerToPoint(8, playerid,364.1431,173.7478,1008.3828))
        {
            if(giveplayerid <= DrugsAmount && giveplayerid >= 0)
         {
                format(string, sizeof(string), "You have deposited %d$ into your drug store.",giveplayerid);
                SendClientMessage(playerid, COLOR_GREEN, string);
                GivePlayerMoney(playerid, -giveplayerid);
                PlayerInfo[playerid][pDrugs] = PlayerInfo[playerid][pDrugs]+giveplayerid;
                DrugsAmount[playerid] = 0;
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED,"You do not have that drugs in your pocket.");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED,"You must be at the drug store to do this command.");
        }
        return 1;
    }
But it gives me the error :
pawn Код:
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(9349) : error 033: array must be indexed (variable "DrugsAmount")
I want if that player is in that point to deposit their drugs they're carring


Re: [HELP]Deposit drugs - fangoth1 - 06.12.2010

this may/may not be the problem
pawn Код:
if(giveplayerid <= 0 DrugsAmount && giveplayerid >= 15000)// i believe that cant be blank where the zero is



Re: [HELP]Deposit drugs - [Aka]Dragonu - 06.12.2010

What's that 15000?


Re: [HELP]Deposit drugs - MiXtap3 - 08.01.2011

You solved the problem man?