Ruind my OnPlayerConnect callback...
#1

Hi, some time ago I have ruind my OnPlayerConnect callback, by making an intro for my server, the intro was kinda cool, but it was a pain in the ass...
About 3 days later I have removed the intro, and now my OnPlayerConnect callback is screwed...
ok so first of all the message: Connected to "servername" comes after all the messages that go under OnPlayerConnect...
also in some cases, OnPlayerSpawn won't be called if I put some code under OnPlayerConnect...
pawn Код:
JobJoy[playerid] = CreateProgressBar(50.0, 300.0, _, _, COLOR_WHITE, 100.0);
    CreateDynamic3DTextLabel("Truckers",COLOR_TRUCKER_LABEL,31.6926,33.2271,7.8162,100.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,-1,-1,playerid,100.0);
    CreateDynamic3DTextLabel("Drivers",COLOR_SEXYGREEN,13.9268,32.6123,7.8162,100.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,-1,-1,playerid,100.0);
    CreateDynamic3DTextLabel("Cops",0x0000FFFF,22.9423,38.0656,7.8172,100.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,-1,-1,playerid,100.0);
    CreateDynamic3DTextLabel("Bandits",COLOR_ORANGE_LABEL,23.0729,27.1979,7.8172,100.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,-1,-1,playerid,100.0);
    CreateDynamic3DTextLabel("JAIL",CAMERA_LABEL_COLOR,31.6932,32.2157,34.9407 + 2.5,100.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,-1,-1,playerid,100.0);
    CreateDynamic3DTextLabel("Team Selection", COLOR_YELLOW_LABEL, 24.0979,32.3672,28.8491, 100.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,-1,-1,playerid,100.0);
    CreateDynamic3DTextLabel("Administration",CAMERA_LABEL_COLOR,14.8863,24.6557,28.8819,100.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,-1,-1,playerid,100.0);
    CreateDynamic3DTextLabel("Level 1 cars",COLOR_SEXYGREEN,745.2821,-1274.2109,13.5547,100.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,-1,-1,playerid,100.0);
    CreateDynamic3DTextLabel("Level 2 cars",COLOR_SEXYGREEN,767.8124,-1272.3501,15.9031,100.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,-1,-1,playerid,100.0);
    CreateDynamic3DTextLabel("Level 3 cars",COLOR_SEXYGREEN,770.6702,-1250.1125,19.1845,100.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,-1,-1,playerid,100.0);
    CreateDynamic3DTextLabel("allowed speed: 90",CAMERA_LABEL_COLOR,gObjects90[0][0], gObjects90[0][1], gObjects90[0][2]+3.5,100,0,0);
    CreateDynamic3DTextLabel("allowed speed: 90",CAMERA_LABEL_COLOR,gObjects90[1][0], gObjects90[1][1], gObjects90[1][2]+3.5,100,0,0);
    CreateDynamic3DTextLabel("allowed speed: 90",CAMERA_LABEL_COLOR,gObjects90[2][0], gObjects90[2][1], gObjects90[2][2]+3.5,100,0,0);
    CreateDynamic3DTextLabel("allowed speed: 120",CAMERA_LABEL_COLOR,gObjects120[0][0], gObjects120[0][1], gObjects120[0][2]+3.5,100,0,0);
    CreateDynamic3DTextLabel("allowed speed: 120",CAMERA_LABEL_COLOR,gObjects120[1][0], gObjects120[1][1], gObjects120[1][2]+3.5,100,0,0);
    CreateDynamic3DTextLabel("Bandit's hangout!", 0xFFFF0FFF, 738.939392, -1417.989379, 13.523437 + 1.5, 100.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,-1,-1,playerid,100.0);
    CreateDynamic3DTextLabel("LSPD", 0xFFFF0FFF, 1583.388793, -1637.996704, 13.375892 + 1.5, 100.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,-1,-1,playerid,100.0);
   
    Drolla = CreateDynamicRectangle(1317.5862, -1582.1971, 1307.4509, -1842.4286, -1, -1, playerid);

    // toggles
    Speedometer_Setup(playerid);
    // variables
    SetPVarInt(playerid, "Talk", 0);
    pPeppersprayed[playerid] = 0;
    pInfo[playerid][pTazed] = 0;
    cinfo[playerid] = 1;
    antich[playerid] = 0;
    stw[playerid] = 0;
    hsbb[playerid] = 0;
    IsFlashed[playerid] = 0;
    PaidTicket[playerid] = 0;
    IsAnnoyed[playerid] = 0;
    HasAlreadyInfo[playerid] = 0;
    gTeam[playerid] = TEAM_INTRO;
    PoliceWarnedMe[playerid] = false;
    IsWorking[playerid] = false;
    LabelActive[playerid] = false;
    // Td's
    Opdracht[playerid] = TextDrawCreate(320,431.000000,"~r~Bring ~y~ Travis Pastrana ~r~ From ~b~''~y~The HollyWood Hotel~b~''~r~ To ~y~The stadium!");
    /*TextDrawAlignment(Opdracht[playerid], 2);
    TextDrawBackgroundColor(Opdracht[playerid], 0x000000ff);
    TextDrawFont(Opdracht[playerid], 2);*/

    TextDrawLetterSize(Opdracht[playerid], 0.260000, 1.400000);
    TextDrawSetOutline(Opdracht[playerid], 1);
    /*TextDrawColor(Opdracht[playerid], -1);
    TextDrawSetOutline(Opdracht[playerid], 1);
    TextDrawSetProportional(Opdracht[playerid], 1);
    TextDrawUseBox(Opdracht[playerid], 1);
    TextDrawBoxColor(Opdracht[playerid], 102);
    TextDrawTextSize(Opdracht[playerid], 0.000000, 801.000000);*/

    TextDrawBackgroundColor(Opdracht[playerid],0x000000ff);
    TextDrawUseBox(Opdracht[playerid], 1);
    TextDrawBoxColor(Opdracht[playerid], 0x000000AA);
    TextDrawAlignment(Opdracht[playerid], 2);
    TextDrawFont(Opdracht[playerid],2);
    //TextDrawLetterSize(Opdracht[playerid],0.3,1);
   
    MessageTD[playerid] = TextDrawCreate(241.000000, 410.000000, "TICKET RECIEVED");
    TextDrawBackgroundColor(MessageTD[playerid], 255);
    TextDrawFont(MessageTD[playerid], 1);
    TextDrawLetterSize(MessageTD[playerid], 0.549999, 1.500000);
    TextDrawColor(MessageTD[playerid], -1);
    TextDrawSetOutline(MessageTD[playerid], 0);
    TextDrawSetProportional(MessageTD[playerid], 1);
    TextDrawSetShadow(MessageTD[playerid], 1);
    TextDrawUseBox(MessageTD[playerid], 1);
    TextDrawBoxColor(MessageTD[playerid], 255);
    TextDrawTextSize(MessageTD[playerid], 384.000000, 0.000000);
    JailTimer[playerid] = TextDrawCreate(505.000000, 411.000000, "Jailtime: 180");
    TextDrawBackgroundColor(JailTimer[playerid], -1);
    TextDrawFont(JailTimer[playerid], 3);
    TextDrawLetterSize(JailTimer[playerid], 0.529999, 1.299999);
    TextDrawColor(JailTimer[playerid], 65535);
    TextDrawSetOutline(JailTimer[playerid], 1);
    TextDrawSetProportional(JailTimer[playerid], 1);
    TextDrawUseBox(JailTimer[playerid], 1);
    TextDrawBoxColor(JailTimer[playerid], 255);
    TextDrawTextSize(JailTimer[playerid], 633.000000, 0.000000);
    SPEEDOS[playerid] = TextDrawCreate(10.0,200.0," ");
    TextDrawShowForPlayer(playerid,SPEEDOS[playerid]);
    TextDrawShowForPlayer(playerid,talking);
   
    iwt[playerid] = TextDrawCreate(534, 399,"Working:");
    TextDrawFont(iwt[playerid],1);
   
    vhealth[playerid] = TextDrawCreate(534, 389," ");
    TextDrawFont(vhealth[playerid],1);
   
    TextDrawShowForPlayer(playerid,vhealth[playerid]);
    // other
    SetPlayerSkillLevel(playerid, 0, 999);
    SetPlayerSkillLevel(playerid, 1, 999);
    SetPlayerSkillLevel(playerid, 2, 999);
    SetPlayerSkillLevel(playerid, 3, 999);
    SetPlayerSkillLevel(playerid, 4, 999);
    SetPlayerSkillLevel(playerid, 5, 999);
    SetPlayerSkillLevel(playerid, 6, 999);
    SetPlayerSkillLevel(playerid, 7, 999);
    SetPlayerSkillLevel(playerid, 8, 999);
    SetPlayerSkillLevel(playerid, 9, 999);
    SetPlayerSkillLevel(playerid, 10, 999);
    // timers
    SetTimer("score_level", 59999, true);
    SetTimer("score_check", 1000, true); //Check player score to make sure he doesn't enter a vehicle that is not his level yet

    return 1;
}
I have one classes in my server, and it doesn't get shown either, I just get the connect screen, that LS coast screen...

so can anyone help me fix this?
also the wlecome message is in another FS.

Thanks in advance.
Reply
#2

When you make a big update just create a new version for your script and keep backups of the old. It takes you about 10 seconds (if not much shorter) and it'll save you alot of time.
Reply
#3

so there's not really any solution for this?
Reply
#4

Nearly everything you've put under OnPlayerConnect can be done in OnGameModeInit. What's the point of creating the 3D labels for each player separately? I'm sure the streamer plugin allows the creation of these globally. The textdraws can also be created in OnGameModeInit if you use a MAX_PLAYER loop there. Then, last but not least, when starting timers under OnPlayerConnect, it's usually a requirement to use SetTimerEx to pass the playerid parameter to the function you're calling.
Reply
#5

Thanks for the tips! +rep
Reply
#6

I tried to copy my gm and paste in a new pawn... But it did not work... Its not possible that there is no solution... Anyone?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)