Drugs & Mats bug
#7

pawn Код:
if(strcmp(x_nr,"drugs",true) == 0)
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /anna drugs [playerid/PartOfName] [amount]");
                    return 1;
                }
                giveplayerid = ReturnUser(tmp);
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        new Float:x, Float:y, Float:z;
                        GetPlayerPos(giveplayerid,x,y,z);
                        if(!PlayerToPoint(5, playerid, x, y, z))
                        {
                            SendClientMessage(playerid, COLOR_GRAD1, "   Player is not near you!");
                            return 1;
                        }
                        tmp = strtok(cmdtext, idx);
                        if(!strlen(tmp))
                        {
                            SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /anna drugs [playerid/PartOfName] [amount]");
                            return 1;
                        }
                        new asammount;
                        asammount = strval(tmp);
                        //if(asammount >= PlayerInfo[playerid][pDrugs]) { SendClientMessage(playerid, COLOR_GREY, "   You don't have so many drugs."); return 1; }
                        if(PlayerInfo[playerid][pDrugs] > asamount) return SendClientMessage(playerid,COLOR_GRAD1,"You dont have many drugs!");
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        PlayerInfo[playerid][pDrugs] -= asammount;
                        PlayerInfo[giveplayerid][pDrugs] += asammount;
                        if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his sack with drugs and hands it to %s.", sendername, giveplayer); }
                        else { format(string, sizeof(string), "* %s takes out her sack with drugs and hands it to %s.", sendername, giveplayer); }
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "   Player is Offline!");
                    return 1;
                }
            }
Right?
Reply


Messages In This Thread
Drugs & Mats bug - by Typhome - 08.07.2010, 18:47
Re: Drugs & Mats bug - by Typhome - 08.07.2010, 20:30
Re: Drugs & Mats bug - by Hiddos - 08.07.2010, 20:31
Re: Drugs & Mats bug - by Typhome - 08.07.2010, 21:19
Re: Drugs & Mats bug - by BP13 - 08.07.2010, 21:20
Re: Drugs & Mats bug - by Hiddos - 08.07.2010, 21:22
Re: Drugs & Mats bug - by Typhome - 08.07.2010, 21:24
Re: Drugs & Mats bug - by Typhome - 09.07.2010, 20:20
Re: Drugs & Mats bug - by oliverrud - 09.07.2010, 20:37

Forum Jump:


Users browsing this thread: 1 Guest(s)