Cbase help
#1

Hello, im coding a hideout system for my server and everything works. But i have a problem when i create hideouts with /cbase, after i pickup the created pickup, it dissapears and doesn't create anymore. I wanna create a "freezed" pickup, means i don't want destroy it after pickuped:

pawn Код:
CMD:cbase(playerid, params[])
{
    if(pInfo[playerid][Admin] == 5)
    {
    new price, level, id, int, world, string[128], Float:Xi, Float:Yi, Float:Zi, inti;//All the new defines we will need.
    if(sscanf(params, "dddfff", price, level, inti, Xi, Yi, Zi)) return SendClientMessage(playerid, COLOR_GREY, "YCMD: /createbiz [price] [type] [interior] [X] [Y] [Z]");//d stands for integer, f stands for float.

    if(level < 0 || level > 4) return SendClientMessage(playerid, COLOR_GREY, "YCMD: Type cannot go below 0, or above 10.");//

    if(price < 10000) return SendClientMessage(playerid, COLOR_GREY, "YCMD: Price cannot go below $10,000.");// Check if the price is below 1000, if it is it will return a message saying it.

    for(new h = 1;h < sizeof(BaseInfo);h++)//Loops through all the businesses
    {
        if(BaseInfo[h][bPrice] == 0)//Checks if the price of a business is 0.
        {
            id = h;
            break;//It stops looping if it is.
        }
    }
    new Float:X,Float:Y,Float:Z,Float:A;//More new defines.
    GetPlayerPos(playerid, X, Y, Z);//Gets your player position, and saves it into floats.
    GetPlayerFacingAngle(playerid, A);//Gets your facing angle, and saves it into a float.
    int = GetPlayerInterior(playerid);//Gets your interior, and saves it into a integer.
    world = GetPlayerVirtualWorld(playerid);//Gets your Virtual World, and saves it into a integer
    BaseInfo[id][bInsideInt] = inti;
    BaseInfo[id][bExitX] = Xi;
    BaseInfo[id][bExitY] = Yi;
    BaseInfo[id][bExitZ] = Zi;

    BaseInfo[id][bOwned] = 0;
    BaseInfo[id][bPrice] = price;
    BaseInfo[id][bType] = level;
    BaseInfo[id][bEntranceX] = X;
    BaseInfo[id][bEntranceY] = Y;
    BaseInfo[id][bEntranceZ] = Z;
    BaseInfo[id][bEntranceA] = A;
    BaseInfo[id][bLocked] = 1;

    BaseInfo[id][bInt] =int;
    BaseInfo[id][bWorld] =world;
    BaseInfo[id][bInsideWorld] =id;

    format(string, sizeof(string), "None");
    strmid(BaseInfo[id][bName], string, 0, strlen(string), 255);

    if(BaseInfo[id][bOutsideIcon]) DestroyDynamicPickup(BaseInfo[id][bOutsideIcon]);
    if(BaseInfo[id][bInsideIcon]) DestroyDynamicPickup(BaseInfo[id][bInsideIcon]);
    BaseInfo[id][bOutsideIcon] = CreateDynamicPickup(1272, 19, BaseInfo[id][bEntranceX], BaseInfo[id][bEntranceY], BaseInfo[id][bEntranceZ], BaseInfo[id][bWorld]);//Creates a pickup at your location
    BaseInfo[id][bInsideIcon] = CreateDynamicPickup(1272, 19, BaseInfo[id][bExitX], BaseInfo[id][bExitY], BaseInfo[id][bExitZ], BaseInfo[id][bInsideWorld]);//Creates a pickup at your location
    new file4[40];
    format(file4, sizeof(file4), BPATH, id);
    new INI:File = INI_Open(file4);
    INI_SetTag(File,"data");
    INI_WriteInt(File,"bOwned", BaseInfo[id][bOwned]);
    INI_WriteInt(File,"bPrice", BaseInfo[id][bPrice]);
    INI_WriteString(File,"bOwner", BaseInfo[id][bOwner]);
    INI_WriteInt(File,"bType", BaseInfo[id][bType]);
    INI_WriteInt(File,"bLocked", BaseInfo[id][bLocked]);
    INI_WriteInt(File,"bMoney", BaseInfo[id][bMoney]);
    INI_WriteFloat(File,"bEntranceX", BaseInfo[id][bEntranceX]);
    INI_WriteFloat(File,"bEntranceY", BaseInfo[id][bEntranceY]);
    INI_WriteFloat(File,"bEntranceZ", BaseInfo[id][bEntranceZ]);
    INI_WriteFloat(File,"bEntranceA", BaseInfo[id][bEntranceA]);
    INI_WriteFloat(File,"bExitX", BaseInfo[id][bExitX]);
    INI_WriteFloat(File,"bExitY", BaseInfo[id][bExitY]);
    INI_WriteFloat(File,"bExitZ", BaseInfo[id][bExitZ]);
    INI_WriteFloat(File,"bExitA", BaseInfo[id][bExitA]);
    INI_WriteInt(File,"bInt", BaseInfo[id][bInt]);
    INI_WriteInt(File,"bWorld", BaseInfo[id][bWorld]);
    INI_WriteInt(File,"bInsideInt", BaseInfo[id][bInsideInt]);
    INI_WriteInt(File,"bInsideWorld", BaseInfo[id][bInsideWorld]);
    INI_WriteString(File,"bName", BaseInfo[id][bName]);
    INI_Close(File);
    }
    return 1;
}
Hope i explained myself good.
Reply
#2

Replace type 19 with 23.
Reply
#3

Same problem. Is possible to create a checkpoint instead of a mapicon?
Reply
#4

https://sampwiki.blast.hk/wiki/PickupTypes
Reply
#5

Quote:
Originally Posted by Face9000
Посмотреть сообщение
Same problem. Is possible to create a checkpoint instead of a mapicon?
So you placed 23 in the "type" parameter and when you run over the pickup it disappeares? Fallout in SU gm uses type 23 to create info pickups that never disappear. And it works fine. Weird
Reply
#6

Quote:
Originally Posted by HurtLocker
Посмотреть сообщение
So you placed 23 in the "type" parameter and when you run over the pickup it disappeares? Fallout in SU gm uses type 23 to create info pickups that never disappear. And it works fine. Weird
there is no type 23 last one is 22
Reply
#7

Quote:
Originally Posted by Mr.Valdez
Посмотреть сообщение
there is no type 23 last one is 22
True, but this is the big trick
Reply
#8

Quote:
Originally Posted by Mr.Valdez
Посмотреть сообщение
I know it already.

Quote:
Originally Posted by HurtLocker
Посмотреть сообщение
So you placed 23 in the "type" parameter and when you run over the pickup it disappeares? Fallout in SU gm uses type 23 to create info pickups that never disappear. And it works fine. Weird
Yes, i placed 23 as type and tried 22 too. Still dissapearing.
Reply
#9

Use type 1, that should work.
Reply
#10

Tried already and doesn't work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)