Weird problem using DynamicCP
#1

Hello,

I am using DynamicCP to entered building, everything works when I am the only player online but right after someone login and we are 2 or more in the server nothing hapenned when you go into the checkpoint... that's weird,

Here my code:

pawn Код:
new BankEntrance;
new BankExit;
new BankSystem;
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(PosX[playerid] !=0 && PosY[playerid] !=0 && PosZ[playerid] !=0 && Angle[playerid] != 0)
    {
        SetPlayerPos(playerid,PosX[playerid],PosY[playerid],PosZ[playerid]);
        SetPlayerFacingAngle(playerid,Angle[playerid]);
        SetPlayerInterior(playerid,Interior[playerid]);
        SetPlayerVirtualWorld(playerid,VirtualWorld[playerid]);
    }
    SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
    BankEntrance = CreateDynamicCP(2435.2395,1655.4387,10.8203,1.0,-1,-1,-1,40.0);
    BankExit = CreateDynamicCP(2304.7026,-16.1553,26.7422,1.0,-1,-1,-1,40.0);
    BankSystem = CreateDynamicCP(2316.5315,-10.0041,26.7422,1.0,-1,-1,-1,40.0);
    return 1;
}
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid ==  BankEntrance)
    {
        SetPlayerPos(playerid,2307.9602,-15.7342,26.7496);
        SetPlayerFacingAngle(playerid,270.5396);
        new pname[MAX_PLAYER_NAME], str[128];
        GetPlayerName(playerid, pname, sizeof(pname));
        strreplace(pname, '_', ' ');
        format(str, sizeof(str), "* %s has entered Bank of Downtown Roleplay.", pname);
        ProxDetector(30.0, playerid, str, COLOR_MEDIUMPURPLE, COLOR_MEDIUMPURPLE, COLOR_MEDIUMPURPLE, COLOR_MEDIUMPURPLE, COLOR_MEDIUMPURPLE);
    }
    if(checkpointid == BankExit)
    {
        SetPlayerPos(playerid,2435.1694,1652.7235,10.8203);
        SetPlayerFacingAngle(playerid,182.1696);
        SetPlayerInterior(playerid,0);
        new pname[MAX_PLAYER_NAME], str[128];
        GetPlayerName(playerid, pname, sizeof(pname));
        strreplace(pname, '_', ' ');
        format(str, sizeof(str),"* %s has exited the building.",pname);
        ProxDetector(30.0, playerid, str, COLOR_MEDIUMPURPLE, COLOR_MEDIUMPURPLE, COLOR_MEDIUMPURPLE, COLOR_MEDIUMPURPLE, COLOR_MEDIUMPURPLE);
    }
    if(checkpointid == BankSystem)
    {
        ShowPlayerDialog(playerid,DIALOG_BANK,DIALOG_STYLE_LIST,""COL_BLUE"Downtown Roleplay bank system","Deposit\nWithdraw","Choose","Cancel");
    }
}
Hope someone will find this weird issue, thanks in advance !
Reply
#2

bump, I tryed everything and nothing still the same, how come we're not getting tped when theres more than 1 player
Reply
#3

Add this under OnGameModeInit:
pawn Код:
BankEntrance = CreateDynamicCP(2435.2395,1655.4387,10.8203,1.0,-1,-1,-1,40.0);
    BankExit = CreateDynamicCP(2304.7026,-16.1553,26.7422,1.0,-1,-1,-1,40.0);
    BankSystem = CreateDynamicCP(2316.5315,-10.0041,26.7422,1.0,-1,-1,-1,40.0);
It may help you.

Dont forget to remove it from OnPlayerSpawn.
Reply
#4

Working... that's so stupid every thread about dynamiccp were saying to put them under onplayerspawn ... well thanks +rep
Reply
#5

Quote:
Originally Posted by vernz
Посмотреть сообщение
Working... that's so stupid every thread about dynamiccp where saying to put them under onplayerspawn ... well thanks +rep
Your welcome dude!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)