Command problem
#1

Hello SA-MP community.

Here I have this command that I will post below what my problem is.

When I type /trunk show, it works perfect.

When I type /trunk get it does nothing, how come?

Thanks!

pawn Код:
command(trunk, playerid, params[])
{
    new Float:x, Float:y, Float:z;
    GetVehiclePos(OldCar[playerid], x, y, z);
    if(AccessingTrunk[playerid] == 1)
    {
        if(IsPlayerInRangeOfPoint(playerid, 5.0, x, y, z))
        {
            if(OwnedVeh(OldCar[playerid]) != 0)
            {
                if(strmatch(vInfo[OwnedVeh(OldCar[playerid])][vOwner], pName(playerid)))
                {
                    new string[128];
                    if(isnull(params)) return SendClientMessage(playerid, WHITE, "Server: /trunk [show/get/put]");
                    else
                    {
                        if(strlen(params) > 1)
                        {
                            if(strmatch("show", params))
                            {
                                SendClientMessage(playerid, WHITE, "[TRUNK INVENTORY]");
                                format(string, sizeof(string), "Money: $%d\nMaterials: %d\nCocaine: %d grams\nMoonshine: %d grams", vInfo[OldCar[playerid]][vTrunkMoney], vInfo[OldCar[playerid]][vTrunkMats], vInfo[OldCar[playerid]][vTrunkCocaine], vInfo[OldCar[playerid]][vTrunkMoonshine]);
                                SendClientMessage(playerid, WHITE, string);
                                return 1;
                            }
                            if(strmatch("get", params))
                            {
                                if(isnull(params)) return SendClientMessage(playerid, WHITE, "Server: /trunk get [weapon/money/materials/cocaine/moonshine]");
                                else
                                {
                                    if(strmatch("money", params))
                                    {
                                        if(isnull(params)) return SendClientMessage(playerid, WHITE, "Server: /trunk get money [amount]");
                                        {
                                            if(vInfo[OldCar[playerid]][vTrunkMoney] >= strval(params))
                                            {
                                                Player[playerid][Money] += strval(params);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                else return SendClientMessage(playerid, WHITE, "This isn't your vehicle.");
            }
            else return SendClientMessage(playerid, WHITE, "This vehicle hasn't got a trunk.");
        }
        else return SendClientMessage(playerid, WHITE, "You aren't in range of your own vehicle.");
    }
    else return SendClientMessage(playerid, WHITE, "You aren't accessing any trunk.");
    return 1;
}

Thank you so much!
Reply


Messages In This Thread
Command problem - by iGetty - 28.05.2012, 18:32
Re: Command problem - by iGetty - 28.05.2012, 19:21
Re: Command problem - by mati233 - 28.05.2012, 20:09
Re: Command problem - by iGetty - 28.05.2012, 20:16
Re: Command problem - by mati233 - 28.05.2012, 20:20
Re: Command problem - by iGetty - 28.05.2012, 20:23
Re: Command problem - by mati233 - 28.05.2012, 20:27
Re: Command problem - by iGetty - 28.05.2012, 20:34
Re: Command problem - by mati233 - 28.05.2012, 20:40
Re: Command problem - by iGetty - 28.05.2012, 20:53

Forum Jump:


Users browsing this thread: 1 Guest(s)