I desperately need help big time please
#1

Well i have been trying so hard and no one seems to want to help me

Pretty much i have made the boot open of the back of my car an everything but i just cant figure out howt o make it so you can store weapons in there or nothing and then take them back out I really need this in my script, I would love if someone could help me please!

Please help me!

This is in PlayerStats Enum

pawn Код:
CarWeapon1,
    CarWeapon2,
    CarWeapon3,
This is on save player data

pawn Код:
dini_IntSet(string, "CarWeapon1", Player[playerid][CarWeapon1]);
        dini_IntSet(string, "CarWeapon2", Player[playerid][CarWeapon2]);
        dini_IntSet(string, "CarWeapon3", Player[playerid][CarWeapon3]);
This is my command to open the boot please help me


pawn Код:
command(carboot, playerid, params[])
{
    new engine, lights, alarm, doors, bonnet, boot, objective, string[128];
    if(IsPlayerNearBoot( playerid, Player[playerid][CarLinkID]))
    {
        if(Player[playerid][CarBootOpen] == 0)
        {
            GetVehicleParamsEx(Player[playerid][CarLinkID], engine, lights, alarm, doors, bonnet, boot, objective);
            Player[playerid][CarBootOpen] = 1;
            SetVehicleParamsEx(Player[playerid][CarLinkID], engine, lights, alarm, doors, bonnet, 1, 0);
            format(string, sizeof(string), "%s has opened their boot of their car", GetNameNoUnderScore(playerid));
            NearByMessage(playerid, PURPLE, string);
        }
        else
        {
            SendClientMessage(playerid, WHITE, "Your boot is already open");
        }
    }
    if(IsPlayerNearBoot( playerid, Player[playerid][Car2LinkID]))
    {
        if(Player[playerid][Car2BootOpen] == 0)
        {
            GetVehicleParamsEx(Player[playerid][Car2LinkID], engine, lights, alarm, doors, bonnet, boot, objective);
            Player[playerid][Car2BootOpen] = 1;
            SetVehicleParamsEx(Player[playerid][Car2LinkID], engine, lights, alarm, doors, bonnet, 1, 0);
            format(string, sizeof(string), "%s has opened their boot of their car", GetNameNoUnderScore(playerid));
            NearByMessage(playerid, PURPLE, string);
        }
        else
        {
            SendClientMessage(playerid, WHITE, "Your boot is already open");
        }
    }
    if(IsPlayerNearBoot( playerid, Player[playerid][Car3LinkID]))
    {
        if(Player[playerid][Car3BootOpen] == 0)
        {
            GetVehicleParamsEx(Player[playerid][Car3LinkID], engine, lights, alarm, doors, bonnet, boot, objective);
            Player[playerid][Car3BootOpen] = 1;
            SetVehicleParamsEx(Player[playerid][Car3LinkID], engine, lights, alarm, doors, bonnet, 1, 0);
            format(string, sizeof(string), "%s has opened their boot of their car", GetNameNoUnderScore(playerid));
            NearByMessage(playerid, PURPLE, string);
        }
        else
        {
            SendClientMessage(playerid, WHITE, "Your boot is already open");
        }
    }
}
Please im begging i really need to know how to store weapons in my boot and take them out if you need any more code just ask please

Help Is Really Really Appreciated
Reply
#2

Edit this: This is a straight copy from one of my earlyer versions, before mysql:


pawn Код:
CMD:tinfo(playerid, params[])
{
    new count = 0;
    new count2 = 0;
    for(new i = Index[topnumber]; i < MAX_VEHICLES; i++)
    {
        new Float:ppx, Float:ppy, Float:ppz;
        GetVehiclePos(i, ppx, ppy, ppz);
        if(IsPlayerInRangeOfPoint(playerid, 3.5, ppx, ppy, ppz))
        {
            count2++;
        }
    }
    for(new v = 1; v < Index[topnumber]; v++)
    {
        new Float:vpx, Float:vpy, Float:vpz;
        GetVehiclePos(v, vpx, vpy, vpz);
        if(IsPlayerInRangeOfPoint(playerid, 3.5, vpx, vpy, vpz))
        {
            count++;
        }
    }
    if(count > 0)
    {
        for(new v = 1; v < Index[topnumber]; v++)
        {
            new Float:vpx, Float:vpy, Float:vpz;
            GetVehiclePos(v, vpx, vpy, vpz);
            if(IsPlayerInRangeOfPoint(playerid, 3.5, vpx, vpy, vpz))
            {
            if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_GREY, "You can't do this when your inside the car!");
            if(vehilocked[v] == 1) return SendClientMessage(playerid, COLOR_RED, "This vehicle is locked!");
            new wepname1[24], wepname2[24], wepname3[24];
            new name[24];
            GetPlayerName(playerid, name, 24);
            new str[128], str2[128], str3[128], str4[128];
            GetWeaponName(trunk[v][vwep1], wepname1, 24);
            GetWeaponName(trunk[v][vwep2], wepname2, 24);
            GetWeaponName(trunk[v][vwep3], wepname3, 24);
            format(str, sizeof(str), "Slot 1: %s Ammo: %d", wepname1, trunk[v][vwep1a]);
            format(str2, sizeof(str2), "Slot 2: %s Ammo: %d", wepname2, trunk[v][vwep2a]);
            format(str3, sizeof(str3), "Slot 3: %s Ammo: %d", wepname3, trunk[v][vwep3a]);
            format(str4, sizeof(str4), "*%s opens the trunk to check what's inside", name);
            SendClientMessage(playerid, COLOR_ORANGE, "||===========|| TRUNK ||===========||");
            SendClientMessage(playerid, COLOR_GREENISHGOLD, str);
            SendClientMessage(playerid, COLOR_GREENISHGOLD, str2);
            SendClientMessage(playerid, COLOR_GREENISHGOLD, str3);
            LocalChat(25.0, playerid, str4, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            GetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,true,objective);
            carboot[v] = 1;
            return 1;
            }
        }
    }
    else if(count2 > 0)
    {
        for(new v = Index[topnumber]; v < MAX_VEHICLES; v++)
        {
            new Float:vpx, Float:vpy, Float:vpz;
            GetVehiclePos(v, vpx, vpy, vpz);
            if(IsPlayerInRangeOfPoint(playerid, 3.5, vpx, vpy, vpz))
            {
            if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_GREY, "You can't do this when your inside the car!");
            if(vteam[v] != 0 && vteam[v] != PlayerInfo[playerid][Fmember]) return SCM(playerid, COLOR_GREY, "You can not acces this vehicle!");
            new wepname1[24], wepname2[24];
            new name[24];
            GetPlayerName(playerid, name, 24);
            new str[128], str2[128], str4[128];
            GetWeaponName(ptrunk1[v], wepname1, 24);
            GetWeaponName(ptrunk2[v], wepname2, 24);
            format(str, sizeof(str), "Slot 1: %s Ammo: %d", wepname1, ptrunk1a[v]);
            format(str2, sizeof(str2), "Slot 2: %s Ammo: %d", wepname2, ptrunk2a[v]);
            format(str4, sizeof(str4), "*%s opens the trunk to check what's inside", name);
            SendClientMessage(playerid, COLOR_ORANGE, "||===========|| TRUNK ||===========||");
            SendClientMessage(playerid, COLOR_GREENISHGOLD, str);
            SendClientMessage(playerid, COLOR_GREENISHGOLD, str2);
            LocalChat(25.0, playerid, str4, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            GetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,true,objective);
            carboot[v] = 1;
            return 1;
            }
        }
    }
    else if(count2 == 0 && count == 0)
    {
        SCM(playerid, COLOR_GREY, "Not near any vehicles!");
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by milanosie
Посмотреть сообщение
Edit this: This is a straight copy from one of my earlyer versions, before mysql:


pawn Код:
CMD:tinfo(playerid, params[])
{
    new count = 0;
    new count2 = 0;
    for(new i = Index[topnumber]; i < MAX_VEHICLES; i++)
    {
        new Float:ppx, Float:ppy, Float:ppz;
        GetVehiclePos(i, ppx, ppy, ppz);
        if(IsPlayerInRangeOfPoint(playerid, 3.5, ppx, ppy, ppz))
        {
            count2++;
        }
    }
    for(new v = 1; v < Index[topnumber]; v++)
    {
        new Float:vpx, Float:vpy, Float:vpz;
        GetVehiclePos(v, vpx, vpy, vpz);
        if(IsPlayerInRangeOfPoint(playerid, 3.5, vpx, vpy, vpz))
        {
            count++;
        }
    }
    if(count > 0)
    {
        for(new v = 1; v < Index[topnumber]; v++)
        {
            new Float:vpx, Float:vpy, Float:vpz;
            GetVehiclePos(v, vpx, vpy, vpz);
            if(IsPlayerInRangeOfPoint(playerid, 3.5, vpx, vpy, vpz))
            {
            if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_GREY, "You can't do this when your inside the car!");
            if(vehilocked[v] == 1) return SendClientMessage(playerid, COLOR_RED, "This vehicle is locked!");
            new wepname1[24], wepname2[24], wepname3[24];
            new name[24];
            GetPlayerName(playerid, name, 24);
            new str[128], str2[128], str3[128], str4[128];
            GetWeaponName(trunk[v][vwep1], wepname1, 24);
            GetWeaponName(trunk[v][vwep2], wepname2, 24);
            GetWeaponName(trunk[v][vwep3], wepname3, 24);
            format(str, sizeof(str), "Slot 1: %s Ammo: %d", wepname1, trunk[v][vwep1a]);
            format(str2, sizeof(str2), "Slot 2: %s Ammo: %d", wepname2, trunk[v][vwep2a]);
            format(str3, sizeof(str3), "Slot 3: %s Ammo: %d", wepname3, trunk[v][vwep3a]);
            format(str4, sizeof(str4), "*%s opens the trunk to check what's inside", name);
            SendClientMessage(playerid, COLOR_ORANGE, "||===========|| TRUNK ||===========||");
            SendClientMessage(playerid, COLOR_GREENISHGOLD, str);
            SendClientMessage(playerid, COLOR_GREENISHGOLD, str2);
            SendClientMessage(playerid, COLOR_GREENISHGOLD, str3);
            LocalChat(25.0, playerid, str4, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            GetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,true,objective);
            carboot[v] = 1;
            return 1;
            }
        }
    }
    else if(count2 > 0)
    {
        for(new v = Index[topnumber]; v < MAX_VEHICLES; v++)
        {
            new Float:vpx, Float:vpy, Float:vpz;
            GetVehiclePos(v, vpx, vpy, vpz);
            if(IsPlayerInRangeOfPoint(playerid, 3.5, vpx, vpy, vpz))
            {
            if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_GREY, "You can't do this when your inside the car!");
            if(vteam[v] != 0 && vteam[v] != PlayerInfo[playerid][Fmember]) return SCM(playerid, COLOR_GREY, "You can not acces this vehicle!");
            new wepname1[24], wepname2[24];
            new name[24];
            GetPlayerName(playerid, name, 24);
            new str[128], str2[128], str4[128];
            GetWeaponName(ptrunk1[v], wepname1, 24);
            GetWeaponName(ptrunk2[v], wepname2, 24);
            format(str, sizeof(str), "Slot 1: %s Ammo: %d", wepname1, ptrunk1a[v]);
            format(str2, sizeof(str2), "Slot 2: %s Ammo: %d", wepname2, ptrunk2a[v]);
            format(str4, sizeof(str4), "*%s opens the trunk to check what's inside", name);
            SendClientMessage(playerid, COLOR_ORANGE, "||===========|| TRUNK ||===========||");
            SendClientMessage(playerid, COLOR_GREENISHGOLD, str);
            SendClientMessage(playerid, COLOR_GREENISHGOLD, str2);
            LocalChat(25.0, playerid, str4, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            GetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,true,objective);
            carboot[v] = 1;
            return 1;
            }
        }
    }
    else if(count2 == 0 && count == 0)
    {
        SCM(playerid, COLOR_GREY, "Not near any vehicles!");
    }
    return 1;
}
I need it the same as my enums and if its in any of my owned cars please help im so angry i cant do it
Reply
#4

Quote:
Originally Posted by Geniuss
Посмотреть сообщение
I need it the same as my enums and if its in any of my owned cars please help im so angry i cant do it
How hard can it be to change enums?

wait, let me give you my /trunk store gun.


pawn Код:
CMD:tputgun(playerid, params[])
{
    new count = 0;
    new count2 = 0;
    for(new i = Index[topnumber]; i < MAX_VEHICLES; i++)
    {
        new Float:ppx, Float:ppy, Float:ppz;
        GetVehiclePos(i, ppx, ppy, ppz);
        if(IsPlayerInRangeOfPoint(playerid, 3.5, ppx, ppy, ppz))
        {
            count2++;
        }
    }
    for(new v = 1; v < Index[topnumber]; v++)
    {
        new Float:vpx, Float:vpy, Float:vpz;
        GetVehiclePos(v, vpx, vpy, vpz);
        if(IsPlayerInRangeOfPoint(playerid, 3.5, vpx, vpy, vpz))
        {
            count++;
        }
    }
    if(count > 0)
    {
    for(new v = 1; v < Index[topnumber]; v++)
    {
        new Float:vpx, Float:vpy, Float:vpz;
        GetVehiclePos(v, vpx, vpy, vpz);
        if(IsPlayerInRangeOfPoint(playerid, 3.5, vpx, vpy, vpz))
        {
            new bullets;
            if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_GREY, "You can't do this when your inside the car!");
            if(vehilocked[v] == 1) return SendClientMessage(playerid, COLOR_RED, "This vehicle is locked!");
            if(sscanf(params, "i", bullets)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /tputgun [Ammo]");
            new str[128];
            new name[24];
            GetPlayerName(playerid, name, 24);
            new ammo = GetPlayerAmmo(playerid);
            new weapon = GetPlayerWeapon(playerid);
            if(trunk[v][vwep1] == weapon || trunk[v][vwep1a] == 0)
            {
            new wepn[24];
            GetWeaponName(weapon, wepn, 24);
            if(sscanf(params, "i", bullets)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /tputgun [Ammo]");
            if(bullets > ammo) return SendClientMessage(playerid, COLOR_GREY, "You do not have that much ammo!");
            if(bullets + trunk[v][vwep1a] > 7500) return SendClientMessage(playerid, COLOR_GREY, "Trunk can not have more then 7500 ammo on one slot!");
            if(bullets < 1 ) return SendClientMessage(playerid, COLOR_GREY, "Negative Ammo is not possible! Use /ttakegun instead");
            trunk[v][vwep1] = weapon;
            trunk[v][vwep1a] = trunk[v][vwep1a] + bullets;
            GivePlayerWeapon(playerid, weapon, -bullets);
            format(str, sizeof(str), "%s places their %s into the trunk", name, wepn);
            LocalChat(15.0, playerid, str, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            GetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,true,objective);
            carboot[v] = 1;
            }
            else if(trunk[v][vwep2] == weapon || trunk[v][vwep2a] == 0)
            {
            new wepn[24];
            GetWeaponName(weapon, wepn, 24);
            if(bullets > ammo) return SendClientMessage(playerid, COLOR_GREY, "You do not have that much ammo!");
            if(bullets + trunk[v][vwep2a] > 7500) return SendClientMessage(playerid, COLOR_GREY, "Trunk can not have more then 7500 ammo on one slot!");
            if(bullets < 1 ) return SendClientMessage(playerid, COLOR_GREY, "Negative Ammo is not possible! Use /ttakegun instead");
            trunk[v][vwep2] = weapon;
            trunk[v][vwep2a] = trunk[v][vwep2a] + bullets;
            GivePlayerWeapon(playerid, weapon, -bullets);
            format(str, sizeof(str), "%s places their %s into the trunk", name, wepn);
            LocalChat(15.0, playerid, str, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            GetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,true,objective);
            carboot[v] = 1;
            }
            else if(trunk[v][vwep3] == weapon || trunk[v][vwep3a] == 0)
            {
            new wepn[24];
            GetWeaponName(weapon, wepn, 24);
            if(bullets > ammo) return SendClientMessage(playerid, COLOR_GREY, "You do not have that much ammo!");
            if(bullets + trunk[v][vwep3a] > 7500) return SendClientMessage(playerid, COLOR_GREY, "Trunk can not have more then 7500 ammo on one slot!");
            if(bullets < 1 ) return SendClientMessage(playerid, COLOR_GREY, "Negative Ammo is not possible! Use /ttakegun instead");
            trunk[v][vwep3] = weapon;
            trunk[v][vwep3a] = trunk[v][vwep3a] + bullets;
            GivePlayerWeapon(playerid, weapon, -bullets);
            format(str, sizeof(str), "%s places their %s into the trunk", name, wepn);
            LocalChat(15.0, playerid, str, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            GetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,true,objective);
            carboot[v] = 1;
            }
            else
            {
                SCM(playerid, COLOR_GREY, "The trunk is full! Take some stuff out first!");
            }
            return 1;
        }
    }
    }
    else if(count2 > 0)
    {
    for(new v = Index[topnumber]; v < MAX_VEHICLES; v++)
    {
        new Float:vpx, Float:vpy, Float:vpz;
        GetVehiclePos(v, vpx, vpy, vpz);
        if(IsPlayerInRangeOfPoint(playerid, 3.5, vpx, vpy, vpz))
        {
            new bullets;
            if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_GREY, "You can't do this when your inside the car!");
            if(vteam[v] != 0 && vteam[v] != PlayerInfo[playerid][Fmember]) return SCM(playerid, COLOR_GREY, "You can not acces this vehicle!");
            if(sscanf(params, "i", bullets)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /tputgun [Ammo]");
            new str[128];
            new name[24];
            GetPlayerName(playerid, name, 24);
            new ammo = GetPlayerAmmo(playerid);
            new weapon = GetPlayerWeapon(playerid);
            if(ptrunk1[v] == weapon || ptrunk1a[v] == 0)
            {
            new wepn[24];
            GetWeaponName(weapon, wepn, 24);
            if(sscanf(params, "i", bullets)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /tputgun [Ammo]");
            if(bullets > ammo) return SendClientMessage(playerid, COLOR_GREY, "You do not have that much ammo!");
            if(bullets + ptrunk1a[v] > 7500) return SendClientMessage(playerid, COLOR_GREY, "Trunk can not have more then 7500 ammo on one slot!");
            if(bullets < 1 ) return SendClientMessage(playerid, COLOR_GREY, "Negative Ammo is not possible! Use /ttakegun instead");
            ptrunk1[v] = weapon;
            ptrunk1a[v] = ptrunk1a[v] + bullets;
            GivePlayerWeapon(playerid, weapon, -bullets);
            format(str, sizeof(str), "%s places their %s into the trunk", name, wepn);
            LocalChat(15.0, playerid, str, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            GetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,true,objective);
            carboot[v] = 1;
            }
            else if(ptrunk2[v] == weapon || ptrunk2a[v] == 0)
            {
            new wepn[24];
            GetWeaponName(weapon, wepn, 24);
            if(sscanf(params, "i", bullets)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /tputgun [Ammo]");
            if(bullets > ammo) return SendClientMessage(playerid, COLOR_GREY, "You do not have that much ammo!");
            if(bullets + ptrunk2a[v] > 7500) return SendClientMessage(playerid, COLOR_GREY, "Trunk can not have more then 7500 ammo on one slot!");
            if(bullets < 1 ) return SendClientMessage(playerid, COLOR_GREY, "Negative Ammo is not possible! Use /ttakegun instead");
            ptrunk2[v] = weapon;
            ptrunk2a[v] = ptrunk2a[v] + bullets;
            GivePlayerWeapon(playerid, weapon, -bullets);
            format(str, sizeof(str), "%s places their %s into the trunk", name, wepn);
            LocalChat(15.0, playerid, str, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            GetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,true,objective);
            carboot[v] = 1;
            }
            return 1;
            }
            }
        }
        else if(count2 == 0 && count == 0)
        {
            SCM(playerid, COLOR_GREY, "You are not near any vehicles!");
        }
        return 1;
}

I gave you everything now, your job is to pick out what you need, and leave what you don't need.
I am NOT going to make the command for you, that way you won't learn anything,
Reply
#5

Quote:
Originally Posted by milanosie
Посмотреть сообщение
How hard can it be to change enums?

wait, let me give you my /trunk store gun.


pawn Код:
CMD:tputgun(playerid, params[])
{
    new count = 0;
    new count2 = 0;
    for(new i = Index[topnumber]; i < MAX_VEHICLES; i++)
    {
        new Float:ppx, Float:ppy, Float:ppz;
        GetVehiclePos(i, ppx, ppy, ppz);
        if(IsPlayerInRangeOfPoint(playerid, 3.5, ppx, ppy, ppz))
        {
            count2++;
        }
    }
    for(new v = 1; v < Index[topnumber]; v++)
    {
        new Float:vpx, Float:vpy, Float:vpz;
        GetVehiclePos(v, vpx, vpy, vpz);
        if(IsPlayerInRangeOfPoint(playerid, 3.5, vpx, vpy, vpz))
        {
            count++;
        }
    }
    if(count > 0)
    {
    for(new v = 1; v < Index[topnumber]; v++)
    {
        new Float:vpx, Float:vpy, Float:vpz;
        GetVehiclePos(v, vpx, vpy, vpz);
        if(IsPlayerInRangeOfPoint(playerid, 3.5, vpx, vpy, vpz))
        {
            new bullets;
            if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_GREY, "You can't do this when your inside the car!");
            if(vehilocked[v] == 1) return SendClientMessage(playerid, COLOR_RED, "This vehicle is locked!");
            if(sscanf(params, "i", bullets)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /tputgun [Ammo]");
            new str[128];
            new name[24];
            GetPlayerName(playerid, name, 24);
            new ammo = GetPlayerAmmo(playerid);
            new weapon = GetPlayerWeapon(playerid);
            if(trunk[v][vwep1] == weapon || trunk[v][vwep1a] == 0)
            {
            new wepn[24];
            GetWeaponName(weapon, wepn, 24);
            if(sscanf(params, "i", bullets)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /tputgun [Ammo]");
            if(bullets > ammo) return SendClientMessage(playerid, COLOR_GREY, "You do not have that much ammo!");
            if(bullets + trunk[v][vwep1a] > 7500) return SendClientMessage(playerid, COLOR_GREY, "Trunk can not have more then 7500 ammo on one slot!");
            if(bullets < 1 ) return SendClientMessage(playerid, COLOR_GREY, "Negative Ammo is not possible! Use /ttakegun instead");
            trunk[v][vwep1] = weapon;
            trunk[v][vwep1a] = trunk[v][vwep1a] + bullets;
            GivePlayerWeapon(playerid, weapon, -bullets);
            format(str, sizeof(str), "%s places their %s into the trunk", name, wepn);
            LocalChat(15.0, playerid, str, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            GetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,true,objective);
            carboot[v] = 1;
            }
            else if(trunk[v][vwep2] == weapon || trunk[v][vwep2a] == 0)
            {
            new wepn[24];
            GetWeaponName(weapon, wepn, 24);
            if(bullets > ammo) return SendClientMessage(playerid, COLOR_GREY, "You do not have that much ammo!");
            if(bullets + trunk[v][vwep2a] > 7500) return SendClientMessage(playerid, COLOR_GREY, "Trunk can not have more then 7500 ammo on one slot!");
            if(bullets < 1 ) return SendClientMessage(playerid, COLOR_GREY, "Negative Ammo is not possible! Use /ttakegun instead");
            trunk[v][vwep2] = weapon;
            trunk[v][vwep2a] = trunk[v][vwep2a] + bullets;
            GivePlayerWeapon(playerid, weapon, -bullets);
            format(str, sizeof(str), "%s places their %s into the trunk", name, wepn);
            LocalChat(15.0, playerid, str, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            GetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,true,objective);
            carboot[v] = 1;
            }
            else if(trunk[v][vwep3] == weapon || trunk[v][vwep3a] == 0)
            {
            new wepn[24];
            GetWeaponName(weapon, wepn, 24);
            if(bullets > ammo) return SendClientMessage(playerid, COLOR_GREY, "You do not have that much ammo!");
            if(bullets + trunk[v][vwep3a] > 7500) return SendClientMessage(playerid, COLOR_GREY, "Trunk can not have more then 7500 ammo on one slot!");
            if(bullets < 1 ) return SendClientMessage(playerid, COLOR_GREY, "Negative Ammo is not possible! Use /ttakegun instead");
            trunk[v][vwep3] = weapon;
            trunk[v][vwep3a] = trunk[v][vwep3a] + bullets;
            GivePlayerWeapon(playerid, weapon, -bullets);
            format(str, sizeof(str), "%s places their %s into the trunk", name, wepn);
            LocalChat(15.0, playerid, str, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            GetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,true,objective);
            carboot[v] = 1;
            }
            else
            {
                SCM(playerid, COLOR_GREY, "The trunk is full! Take some stuff out first!");
            }
            return 1;
        }
    }
    }
    else if(count2 > 0)
    {
    for(new v = Index[topnumber]; v < MAX_VEHICLES; v++)
    {
        new Float:vpx, Float:vpy, Float:vpz;
        GetVehiclePos(v, vpx, vpy, vpz);
        if(IsPlayerInRangeOfPoint(playerid, 3.5, vpx, vpy, vpz))
        {
            new bullets;
            if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_GREY, "You can't do this when your inside the car!");
            if(vteam[v] != 0 && vteam[v] != PlayerInfo[playerid][Fmember]) return SCM(playerid, COLOR_GREY, "You can not acces this vehicle!");
            if(sscanf(params, "i", bullets)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /tputgun [Ammo]");
            new str[128];
            new name[24];
            GetPlayerName(playerid, name, 24);
            new ammo = GetPlayerAmmo(playerid);
            new weapon = GetPlayerWeapon(playerid);
            if(ptrunk1[v] == weapon || ptrunk1a[v] == 0)
            {
            new wepn[24];
            GetWeaponName(weapon, wepn, 24);
            if(sscanf(params, "i", bullets)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /tputgun [Ammo]");
            if(bullets > ammo) return SendClientMessage(playerid, COLOR_GREY, "You do not have that much ammo!");
            if(bullets + ptrunk1a[v] > 7500) return SendClientMessage(playerid, COLOR_GREY, "Trunk can not have more then 7500 ammo on one slot!");
            if(bullets < 1 ) return SendClientMessage(playerid, COLOR_GREY, "Negative Ammo is not possible! Use /ttakegun instead");
            ptrunk1[v] = weapon;
            ptrunk1a[v] = ptrunk1a[v] + bullets;
            GivePlayerWeapon(playerid, weapon, -bullets);
            format(str, sizeof(str), "%s places their %s into the trunk", name, wepn);
            LocalChat(15.0, playerid, str, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            GetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,true,objective);
            carboot[v] = 1;
            }
            else if(ptrunk2[v] == weapon || ptrunk2a[v] == 0)
            {
            new wepn[24];
            GetWeaponName(weapon, wepn, 24);
            if(sscanf(params, "i", bullets)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /tputgun [Ammo]");
            if(bullets > ammo) return SendClientMessage(playerid, COLOR_GREY, "You do not have that much ammo!");
            if(bullets + ptrunk2a[v] > 7500) return SendClientMessage(playerid, COLOR_GREY, "Trunk can not have more then 7500 ammo on one slot!");
            if(bullets < 1 ) return SendClientMessage(playerid, COLOR_GREY, "Negative Ammo is not possible! Use /ttakegun instead");
            ptrunk2[v] = weapon;
            ptrunk2a[v] = ptrunk2a[v] + bullets;
            GivePlayerWeapon(playerid, weapon, -bullets);
            format(str, sizeof(str), "%s places their %s into the trunk", name, wepn);
            LocalChat(15.0, playerid, str, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            GetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,true,objective);
            carboot[v] = 1;
            }
            return 1;
            }
            }
        }
        else if(count2 == 0 && count == 0)
        {
            SCM(playerid, COLOR_GREY, "You are not near any vehicles!");
        }
        return 1;
}

I gave you everything now, your job is to pick out what you need, and leave what you don't need.
I am NOT going to make the command for you, that way you won't learn anything,
All that makes completely no sense to me please just help me
Reply
#6

Help Is Appreciated
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)