#1

pawn Код:
SetGangEnterAndExit(num)
{
    if(GangEnterPickup[num]!=0)
    {
        DestroyPickup(GangEnterPickup[num]);
    }
    Delete3DTextLabel(GangEnter3dLabel[num]);
    GangEnterPickup[num] = CreatePickup(1318, 1, gGangIntEntrance[num][0],gGangIntEntrance[num][1],gGangIntEntrance[num][2]);
    GangEnter3dLabel[num] = Create3DTextLabel("Entrance",COLOUR_RED, gGangIntEntrance[num][0],gGangIntEntrance[num][1],gGangIntEntrance[num][2]+0.6,20.0,0);
}
This function is called everytime someone types "/createhq1 complite" or "/createhq2 complite".
pawn Код:
dcmd_createhq1(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_LOGGED] == 0 )
    {
            SendClientMessage(playerid,COLOUR_GREY,"ERROR: Please login first to use this commnad");
            return 1;
    }
    if(params[0]=='\0')
    {
        SendClientMessage(playerid,COLOUR_YELLOW2,"Usage: /createhq1 (enter/exit/compliete)");
        return 1;
    }
    if(!strcmp(params, "enter", true, 5))
    {
        SendClientMessage(playerid,COLOUR_GREEN,"You have saved the coordinates of the GangHQentrance.");
        GetPlayerPos(playerid,PLAYER_XPOS[playerid],PLAYER_YPOS[playerid],PLAYER_ZPOS[playerid]);
        gGangIntEntrance[0][0] = PLAYER_XPOS[playerid];
        gGangIntEntrance[0][1] = PLAYER_YPOS[playerid];
        gGangIntEntrance[0][2] = PLAYER_ZPOS[playerid];
        return 1;
    }
    if(!strcmp(params, "exit", true, 4))
    {
        SendClientMessage(playerid,COLOUR_GREEN,"You have saved the coordinates of the GangHQexit.");
        GetPlayerPos(playerid,PLAYER_XPOS[playerid],PLAYER_YPOS[playerid],PLAYER_ZPOS[playerid]);
        gGangIntExit[0][0] = PLAYER_XPOS[playerid];
        gGangIntExit[0][1] = PLAYER_YPOS[playerid];
        gGangIntExit[0][2] = PLAYER_ZPOS[playerid];
        gGangIntVirtualWorld[0]=GetPlayerVirtualWorld(playerid);
        gGangIntInterior[0]=GetPlayerInterior(playerid);
        return 1;
    }
    if(!strcmp(params, "complite", true, 8))
    {
        SetGangEnterAndExit(0);
    }
    return 1;
}

dcmd_createhq2(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_LOGGED] == 0 )
    {
            SendClientMessage(playerid,COLOUR_GREY,"ERROR: Please login first to use this commnad");
            return 1;
    }
    if(params[0]=='\0')
    {
        SendClientMessage(playerid,COLOUR_YELLOW2,"Usage: /createhq2 (enter/exit/compliete)");
        return 1;
    }
    if(!strcmp(params, "enter", true, 5))
    {
        SendClientMessage(playerid,COLOUR_GREEN,"You have saved the coordinates of the GangHQentrance.");
        GetPlayerPos(playerid,PLAYER_XPOS[playerid],PLAYER_YPOS[playerid],PLAYER_ZPOS[playerid]);
        gGangIntEntrance[1][0] = PLAYER_XPOS[playerid];
        gGangIntEntrance[1][1] = PLAYER_YPOS[playerid];
        gGangIntEntrance[1][2] = PLAYER_ZPOS[playerid];
        return 1;
    }
    if(!strcmp(params, "exit", true, 4))
    {
        SendClientMessage(playerid,COLOUR_GREEN,"You have saved the coordinates of the GangHQexit.");
        GetPlayerPos(playerid,PLAYER_XPOS[playerid],PLAYER_YPOS[playerid],PLAYER_ZPOS[playerid]);
        gGangIntExit[1][0] = PLAYER_XPOS[playerid];
        gGangIntExit[1][1] = PLAYER_YPOS[playerid];
        gGangIntExit[1][2] = PLAYER_ZPOS[playerid];
        gGangIntVirtualWorld[1]=GetPlayerVirtualWorld(playerid);
        gGangIntInterior[1]=GetPlayerInterior(playerid);
        return 1;
    }
    if(!strcmp(params, "complite", true, 8))
    {
        SetGangEnterAndExit(1);
    }
    return 1;
}
Okay, When I first set Entrance(/creathehq1 enter) and exit(/creathehq1 exit) of HQ and approve it(/creathehq1 complite) it's okay. Then when I want to make HQ for 2nd gang, everything goes fine except the 3DLabel wich disappears from first entering place(bad) and Pickup still stays on good place(good). Could I ask why?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)