My Server does not continue to go to Class Section
#1

Hello SA-MP Community. I recently added some textdraws to my server which are 2 black boxes on connect that are opposite to eachother. And a textdraw saying the servers name. Also, a moving camera OnConnect. But the bad thing is, the "Spawn" button does not appear so I can not continue to go to class section. Here is the script:

http://pastebin.com/5tLi4dgB

I hope you can help me recover it so I can go to Class Section without having to remove any textdraws and the moving camera. Thanks!

Also, do you think if I added SetTimeEx for like 10 seconds, then do ForceClassSection?

Please help me!
Reply
#2

help
Reply
#3

Set a timer onplayerconnect -
SetTimerEx("ClassSelection",10000,false,"i",player id);
Then
forward ClassSelection(playerid);
public ClassSelection(playerid)
{
ForceClassSelection(playerid);
return 1;
}
Reply
#4

TogglePlayerSpectating(playerid, 1);

When a player is considered 'spectating', AKA toggled to 1, the class selection menu will not show.
People use this to hide their OnPlayerClassSelection so players will go straight through to OnPlayerSpawn.

EDIT: And yes, this is unfortunately in your moving camera function. If you are wanting objects to stream in while the camera is moving, you need to keep it like this, otherwise, just remove it. https://sampwiki.blast.hk/wiki/InterpolateCameraPos
Reply
#5

Where does this go,


Код:
SetTimerEx("ClassSelection",10000,false,"i",player id);
Reply
#6

Quote:
Originally Posted by Infinity90
Посмотреть сообщение
Set a timer onplayerconnect -
SetTimerEx("ClassSelection",10000,false,"i",player id);
Then
forward ClassSelection(playerid);
public ClassSelection(playerid)
{
ForceClassSelection(playerid);
return 1;
}
I done what u said, its not working?
Reply
#7

I've edited your script a little bit to make the moving camera more stable, and so it cooperates with OnPlayerRequestClass or Class Selection.

pawn Код:
/*******************************************************************************
*                SERVER NAME: Los Santos Life Cops n Robbers
*                SERVER VERSION: v1.0
*                SERVER DEVELOPER: Goldkiller & JerryBean
*
*   INFORMATION: Los Santos Life Cops n Robbers is a gamemode which was created
*   on the 19.1.2013. This script contains lots of functions, commands, and
*   admin commands.
*
*   Copyright 2013. Do not steal this Gamemode, if your using it, leave the
*   credits on.
*******************************************************************************/


#include <a_samp>

forward IsConnectCam(playerid);

new Text:Startup0;
new Text:Startup1;
new Text:Startup2;
new Text:Startup3;
new Text:Startup4;
new Text:Startup5;

//------[TEAM DEFINES]------
#define TEAM_COPS 0
#define TEAM_COLOR_COPS COLOR_BLUE
#define TEAM_C.I.A 1
#define TEAM_COLOR_C.I.A COLOR_BLUE
#define TEAM_SWAT 2
#define TEAM_COLOR_SWAT COLOR_AQUA
#define TEAM_ARMY 3
#define TEAM_COLOR_ARMY COLOR_PURPLE
#define TEAM_MEDICS 4
#define TEAM_COLOR_MEDICS COLOR_PINK
#define TEAM_TAXI 5
#define TEAM_COLOR_TAXI COLOR_GREEN
#define TEAM_MECH 6
#define TEAM_COLOR_MECH COLOR_WHITE
#define TEAM_ CIV 7
#define TEAM_COLOR_CIV COLOR_WHITE

//------[COLOR DEFINES]------
/////////TEAM_COLORS/////////
#define COLOR_BLUE 0x00FFFFFF ///Cops & C.I.A
#define COLOR_AQUA 0x00FFFFFF ///SWAT
#define COLOR_PURPLE 0xA200FFFF ///Army
#define COLOR_PINK 0xECC8ECFF ///Medics
#define COLOR_GREEN 0xECC8ECFF ///Taxi
#define COLOR_WHITE 0xFFFFFFFF ///CIV & Mech

//////////OTHER_COLORS//////
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_RED 0xAA3333AA
#define COLOR_LIME 0x10F441AA
#define COLOR_MAGENTA 0xFF00FFFF
#define COLOR_NAVY 0x000080AA
#define COLOR_CRIMSON 0xDC143CAA
#define COLOR_FLBLUE 0x6495EDAA
#define COLOR_BISQUE 0xFFE4C4AA
#define COLOR_BLACK 0x000000AA
#define COLOR_CHARTREUSE 0x7FFF00AA
#define COLOR_BROWN 0XA52A2AAA
#define COLOR_CORAL 0xFF7F50AA
#define COLOR_GOLD 0xB8860BAA
#define COLOR_GREENYELLOW 0xADFF2FAA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_IVORY 0xFFFF82AA
#define COLOR_LAWNGREEN 0x7CFC00AA
#define COLOR_SEAGREEN 0x20B2AAAA
#define COLOR_LIMEGREEN 0x32CD32AA
#define COLOR_MIDNIGHTBLUE 0X191970AA
#define COLOR_MAROON 0x800000AA
#define COLOR_OLIVE 0x808000AA
#define COLOR_ORANGERED 0xFF4500AA
#define COLOR_SPRINGGREEN 0x00FF7FAA
#define COLOR_TOMATO 0xFF6347AA
#define COLOR_YELLOWGREEN 0x9ACD32AA
#define COLOR_MEDIUMAQUA 0x83BFBFAA
#define COLOR_MEDIUMMAGENTA 0x8B008BAA

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("-------------------------------------------");
    print("SERVER: Los Santos Life Cops n Robbers");
    print("VERSION: Mode v1.0");
    print("DEVELOPER: Goldkiller & JerryBean");
    print("-------------------------------------------");
}

#endif

public OnGameModeInit()
{
    Startup0 = TextDrawCreate(645.000000, 2.000000, "_");
    TextDrawBackgroundColor(Startup0, 255);
    TextDrawFont(Startup0, 1);
    TextDrawLetterSize(Startup0, 0.500000, 10.100002);
    TextDrawColor(Startup0, -1);
    TextDrawSetOutline(Startup0, 0);
    TextDrawSetProportional(Startup0, 1);
    TextDrawSetShadow(Startup0, 1);
    TextDrawUseBox(Startup0, 1);
    TextDrawBoxColor(Startup0, 255);
    TextDrawTextSize(Startup0, -5.000000, 0.000000);

    Startup1 = TextDrawCreate(645.000000, 354.000000, "_");
    TextDrawBackgroundColor(Startup1, 255);
    TextDrawFont(Startup1, 1);
    TextDrawLetterSize(Startup1, 0.500000, 10.100002);
    TextDrawColor(Startup1, -1);
    TextDrawSetOutline(Startup1, 0);
    TextDrawSetProportional(Startup1, 1);
    TextDrawSetShadow(Startup1, 1);
    TextDrawUseBox(Startup1, 1);
    TextDrawBoxColor(Startup1, 255);
    TextDrawTextSize(Startup1, -5.000000, 0.000000);

    Startup2 = TextDrawCreate(645.000000, 354.000000, "_");
    TextDrawBackgroundColor(Startup2, 255);
    TextDrawFont(Startup2, 1);
    TextDrawLetterSize(Startup2, 0.500000, 0.000000);
    TextDrawColor(Startup2, -1);
    TextDrawSetOutline(Startup2, 0);
    TextDrawSetProportional(Startup2, 1);
    TextDrawSetShadow(Startup2, 1);
    TextDrawUseBox(Startup2, 1);
    TextDrawBoxColor(Startup2, COLOR_LIGHTBLUE);
    TextDrawTextSize(Startup2, -5.000000, 0.000000);

    Startup3 = TextDrawCreate(645.000000, 93.000000, "_");
    TextDrawBackgroundColor(Startup3, 255);
    TextDrawFont(Startup3, 1);
    TextDrawLetterSize(Startup3, 0.500000, 0.000000);
    TextDrawColor(Startup3, -1);
    TextDrawSetOutline(Startup3, 0);
    TextDrawSetProportional(Startup3, 1);
    TextDrawSetShadow(Startup3, 1);
    TextDrawUseBox(Startup3, 1);
    TextDrawBoxColor(Startup3, COLOR_LIGHTBLUE);
    TextDrawTextSize(Startup3, -5.000000, 0.000000);

    Startup4 = TextDrawCreate(138.000000, 19.000000, "Los Santos Life");
    TextDrawBackgroundColor(Startup4, COLOR_LIGHTBLUE);
    TextDrawFont(Startup4, 2);
    TextDrawLetterSize(Startup4, 0.699999, 4.599997);
    TextDrawColor(Startup4, 255);
    TextDrawSetOutline(Startup4, 1);
    TextDrawSetProportional(Startup4, 1);

    Startup5 = TextDrawCreate(92.000000, 73.000000, "This server may contain explicit content and may be considered only for adults");
    TextDrawBackgroundColor(Startup5, COLOR_LIGHTBLUE);
    TextDrawFont(Startup5, 2);
    TextDrawLetterSize(Startup5, 0.240000, 0.900000);
    TextDrawColor(Startup5, 255);
    TextDrawSetOutline(Startup5, 1);
    TextDrawSetProportional(Startup5, 1);
   
    SetGameModeText("Cops n Robbers");
    //------------------------[PLAYER CLASS SELECTION]--------------------------
    /////////////////////////////////TEAM_COPS//////////////////////////////////
    AddPlayerClass(266, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(265, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(267, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(283, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(288, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(286, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(284, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
    //////////////////////////////////TEAM_C.I.A////////////////////////////////
    AddPlayerClass(165, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(166, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
    //////////////////////////////////TEAM_SWAT///////////////////////////////////
    AddPlayerClass(285, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    /////////////////////////////////TEAM_ARMY///////////////////////////////////
    AddPlayerClass(287, 2778.7278,-2410.4207,13.6359,180.4225, 0, 0, 0, 0, 0, 0);
    ////////////////////////////////TEAM_MEDICS//////////////////////////////////
    AddPlayerClass(276, 2027.7826,-1404.2111,17.2339,179.8795, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(275, 2027.7826,-1404.2111,17.2339,179.8795, 0, 0, 0, 0, 0, 0);
    ///////////////////////////////TEAM_TAXI/////////////////////////////////////
    AddPlayerClass(261, 1770.8652,-1861.5470,13.5774,358.8449, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(7, 1770.8652,-1861.5470,13.5774,358.8449, 0, 0, 0, 0, 0, 0);
    //////////////////////////////TEAM_MECH//////////////////////////////////////
    AddPlayerClass(50, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    //////////////////////////////TEAM_CIV///////////////////////////////////////
    AddPlayerClass(2, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(3, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(21, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(22, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(23, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(29, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(47, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(48, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(12, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(24, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(25, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(26, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(28, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(86, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(100, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(103, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(104, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(106, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(107, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(108, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(147, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(149, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(180, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(188, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(217, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(223, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(247, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(248, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(250, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(254, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(264, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(46, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(294, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid,Startup0);
    TextDrawShowForPlayer(playerid,Startup1);
    TextDrawShowForPlayer(playerid,Startup2);
    TextDrawShowForPlayer(playerid,Startup3);
    TextDrawShowForPlayer(playerid,Startup4);
    TextDrawShowForPlayer(playerid,Startup5);
    SetTimerEx("IsConnectCam", 100, false, "d", playerid);
    PlayAudioStreamForPlayer(playerid, "http://mixconnect.com/disk2/mp3/1e1a51b28bdc93803dcbf.mp3");
    return 1;
}

public IsConnectCam(playerid)
{
    TogglePlayerSpectating(playerid, 1);
    InterpolateCameraPos(playerid, 717.397277, -2301.807128, -1.083266, 726.019531, -1556.596557, 39.256973, 10000, CAMERA_MOVE);
    InterpolateCameraLookAt(playerid, 717.506347, -2296.874755, -0.270482, 726.100646, -1551.723266, 38.141441, 10000, CAMERA_MOVE);
    SetTimerEx("ToClass", 12000, false, "i", playerid);
    return 1;
}

forward ToClass(playerid);
public ToClass(playerid)
{
    TogglePlayerSpectating(playerid, 0);
    ForceClassSelection(playerid);
    return 1;
}


public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetCameraBehindPlayer(playerid);
        TogglePlayerSpectating(playerid, 0);
        TextDrawHideForPlayer(playerid, Startup0);
    TextDrawHideForPlayer(playerid, Startup1);
    TextDrawHideForPlayer(playerid, Startup2);
    TextDrawHideForPlayer(playerid, Startup3);
    TextDrawHideForPlayer(playerid, Startup4);
    TextDrawHideForPlayer(playerid, Startup5);
    StopAudioStreamForPlayer(playerid);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        // Do something here
        return 1;
    }
    return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}
Reply
#8

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
I've edited your script a little bit to make the moving camera more stable, and so it cooperates with OnPlayerRequestClass or Class Selection.

pawn Код:
/*******************************************************************************
*                SERVER NAME: Los Santos Life Cops n Robbers
*                SERVER VERSION: v1.0
*                SERVER DEVELOPER: Goldkiller & JerryBean
*
*   INFORMATION: Los Santos Life Cops n Robbers is a gamemode which was created
*   on the 19.1.2013. This script contains lots of functions, commands, and
*   admin commands.
*
*   Copyright 2013. Do not steal this Gamemode, if your using it, leave the
*   credits on.
*******************************************************************************/


#include <a_samp>

forward IsConnectCam(playerid);

new Text:Startup0;
new Text:Startup1;
new Text:Startup2;
new Text:Startup3;
new Text:Startup4;
new Text:Startup5;

//------[TEAM DEFINES]------
#define TEAM_COPS 0
#define TEAM_COLOR_COPS COLOR_BLUE
#define TEAM_C.I.A 1
#define TEAM_COLOR_C.I.A COLOR_BLUE
#define TEAM_SWAT 2
#define TEAM_COLOR_SWAT COLOR_AQUA
#define TEAM_ARMY 3
#define TEAM_COLOR_ARMY COLOR_PURPLE
#define TEAM_MEDICS 4
#define TEAM_COLOR_MEDICS COLOR_PINK
#define TEAM_TAXI 5
#define TEAM_COLOR_TAXI COLOR_GREEN
#define TEAM_MECH 6
#define TEAM_COLOR_MECH COLOR_WHITE
#define TEAM_ CIV 7
#define TEAM_COLOR_CIV COLOR_WHITE

//------[COLOR DEFINES]------
/////////TEAM_COLORS/////////
#define COLOR_BLUE 0x00FFFFFF ///Cops & C.I.A
#define COLOR_AQUA 0x00FFFFFF ///SWAT
#define COLOR_PURPLE 0xA200FFFF ///Army
#define COLOR_PINK 0xECC8ECFF ///Medics
#define COLOR_GREEN 0xECC8ECFF ///Taxi
#define COLOR_WHITE 0xFFFFFFFF ///CIV & Mech

//////////OTHER_COLORS//////
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_RED 0xAA3333AA
#define COLOR_LIME 0x10F441AA
#define COLOR_MAGENTA 0xFF00FFFF
#define COLOR_NAVY 0x000080AA
#define COLOR_CRIMSON 0xDC143CAA
#define COLOR_FLBLUE 0x6495EDAA
#define COLOR_BISQUE 0xFFE4C4AA
#define COLOR_BLACK 0x000000AA
#define COLOR_CHARTREUSE 0x7FFF00AA
#define COLOR_BROWN 0XA52A2AAA
#define COLOR_CORAL 0xFF7F50AA
#define COLOR_GOLD 0xB8860BAA
#define COLOR_GREENYELLOW 0xADFF2FAA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_IVORY 0xFFFF82AA
#define COLOR_LAWNGREEN 0x7CFC00AA
#define COLOR_SEAGREEN 0x20B2AAAA
#define COLOR_LIMEGREEN 0x32CD32AA
#define COLOR_MIDNIGHTBLUE 0X191970AA
#define COLOR_MAROON 0x800000AA
#define COLOR_OLIVE 0x808000AA
#define COLOR_ORANGERED 0xFF4500AA
#define COLOR_SPRINGGREEN 0x00FF7FAA
#define COLOR_TOMATO 0xFF6347AA
#define COLOR_YELLOWGREEN 0x9ACD32AA
#define COLOR_MEDIUMAQUA 0x83BFBFAA
#define COLOR_MEDIUMMAGENTA 0x8B008BAA

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("-------------------------------------------");
    print("SERVER: Los Santos Life Cops n Robbers");
    print("VERSION: Mode v1.0");
    print("DEVELOPER: Goldkiller & JerryBean");
    print("-------------------------------------------");
}

#endif

public OnGameModeInit()
{
    Startup0 = TextDrawCreate(645.000000, 2.000000, "_");
    TextDrawBackgroundColor(Startup0, 255);
    TextDrawFont(Startup0, 1);
    TextDrawLetterSize(Startup0, 0.500000, 10.100002);
    TextDrawColor(Startup0, -1);
    TextDrawSetOutline(Startup0, 0);
    TextDrawSetProportional(Startup0, 1);
    TextDrawSetShadow(Startup0, 1);
    TextDrawUseBox(Startup0, 1);
    TextDrawBoxColor(Startup0, 255);
    TextDrawTextSize(Startup0, -5.000000, 0.000000);

    Startup1 = TextDrawCreate(645.000000, 354.000000, "_");
    TextDrawBackgroundColor(Startup1, 255);
    TextDrawFont(Startup1, 1);
    TextDrawLetterSize(Startup1, 0.500000, 10.100002);
    TextDrawColor(Startup1, -1);
    TextDrawSetOutline(Startup1, 0);
    TextDrawSetProportional(Startup1, 1);
    TextDrawSetShadow(Startup1, 1);
    TextDrawUseBox(Startup1, 1);
    TextDrawBoxColor(Startup1, 255);
    TextDrawTextSize(Startup1, -5.000000, 0.000000);

    Startup2 = TextDrawCreate(645.000000, 354.000000, "_");
    TextDrawBackgroundColor(Startup2, 255);
    TextDrawFont(Startup2, 1);
    TextDrawLetterSize(Startup2, 0.500000, 0.000000);
    TextDrawColor(Startup2, -1);
    TextDrawSetOutline(Startup2, 0);
    TextDrawSetProportional(Startup2, 1);
    TextDrawSetShadow(Startup2, 1);
    TextDrawUseBox(Startup2, 1);
    TextDrawBoxColor(Startup2, COLOR_LIGHTBLUE);
    TextDrawTextSize(Startup2, -5.000000, 0.000000);

    Startup3 = TextDrawCreate(645.000000, 93.000000, "_");
    TextDrawBackgroundColor(Startup3, 255);
    TextDrawFont(Startup3, 1);
    TextDrawLetterSize(Startup3, 0.500000, 0.000000);
    TextDrawColor(Startup3, -1);
    TextDrawSetOutline(Startup3, 0);
    TextDrawSetProportional(Startup3, 1);
    TextDrawSetShadow(Startup3, 1);
    TextDrawUseBox(Startup3, 1);
    TextDrawBoxColor(Startup3, COLOR_LIGHTBLUE);
    TextDrawTextSize(Startup3, -5.000000, 0.000000);

    Startup4 = TextDrawCreate(138.000000, 19.000000, "Los Santos Life");
    TextDrawBackgroundColor(Startup4, COLOR_LIGHTBLUE);
    TextDrawFont(Startup4, 2);
    TextDrawLetterSize(Startup4, 0.699999, 4.599997);
    TextDrawColor(Startup4, 255);
    TextDrawSetOutline(Startup4, 1);
    TextDrawSetProportional(Startup4, 1);

    Startup5 = TextDrawCreate(92.000000, 73.000000, "This server may contain explicit content and may be considered only for adults");
    TextDrawBackgroundColor(Startup5, COLOR_LIGHTBLUE);
    TextDrawFont(Startup5, 2);
    TextDrawLetterSize(Startup5, 0.240000, 0.900000);
    TextDrawColor(Startup5, 255);
    TextDrawSetOutline(Startup5, 1);
    TextDrawSetProportional(Startup5, 1);
   
    SetGameModeText("Cops n Robbers");
    //------------------------[PLAYER CLASS SELECTION]--------------------------
    /////////////////////////////////TEAM_COPS//////////////////////////////////
    AddPlayerClass(266, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(265, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(267, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(283, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(288, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(286, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(284, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
    //////////////////////////////////TEAM_C.I.A////////////////////////////////
    AddPlayerClass(165, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(166, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
    //////////////////////////////////TEAM_SWAT///////////////////////////////////
    AddPlayerClass(285, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    /////////////////////////////////TEAM_ARMY///////////////////////////////////
    AddPlayerClass(287, 2778.7278,-2410.4207,13.6359,180.4225, 0, 0, 0, 0, 0, 0);
    ////////////////////////////////TEAM_MEDICS//////////////////////////////////
    AddPlayerClass(276, 2027.7826,-1404.2111,17.2339,179.8795, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(275, 2027.7826,-1404.2111,17.2339,179.8795, 0, 0, 0, 0, 0, 0);
    ///////////////////////////////TEAM_TAXI/////////////////////////////////////
    AddPlayerClass(261, 1770.8652,-1861.5470,13.5774,358.8449, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(7, 1770.8652,-1861.5470,13.5774,358.8449, 0, 0, 0, 0, 0, 0);
    //////////////////////////////TEAM_MECH//////////////////////////////////////
    AddPlayerClass(50, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    //////////////////////////////TEAM_CIV///////////////////////////////////////
    AddPlayerClass(2, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(3, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(21, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(22, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(23, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(29, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(47, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(48, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(12, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(24, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(25, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(26, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(28, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(86, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(100, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(103, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(104, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(106, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(107, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(108, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(147, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(149, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(180, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(188, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(217, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(223, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(247, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(248, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(250, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(254, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(264, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(46, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(294, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid,Startup0);
    TextDrawShowForPlayer(playerid,Startup1);
    TextDrawShowForPlayer(playerid,Startup2);
    TextDrawShowForPlayer(playerid,Startup3);
    TextDrawShowForPlayer(playerid,Startup4);
    TextDrawShowForPlayer(playerid,Startup5);
    SetTimerEx("IsConnectCam", 100, false, "d", playerid);
    PlayAudioStreamForPlayer(playerid, "http://mixconnect.com/disk2/mp3/1e1a51b28bdc93803dcbf.mp3");
    return 1;
}

public IsConnectCam(playerid)
{
    TogglePlayerSpectating(playerid, 1);
    InterpolateCameraPos(playerid, 717.397277, -2301.807128, -1.083266, 726.019531, -1556.596557, 39.256973, 10000, CAMERA_MOVE);
    InterpolateCameraLookAt(playerid, 717.506347, -2296.874755, -0.270482, 726.100646, -1551.723266, 38.141441, 10000, CAMERA_MOVE);
    SetTimerEx("ToClass", 12000, false, "i", playerid);
    return 1;
}

forward ToClass(playerid);
public ToClass(playerid)
{
    TogglePlayerSpectating(playerid, 0);
    ForceClassSelection(playerid);
    return 1;
}


public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetCameraBehindPlayer(playerid);
        TogglePlayerSpectating(playerid, 0);
        TextDrawHideForPlayer(playerid, Startup0);
    TextDrawHideForPlayer(playerid, Startup1);
    TextDrawHideForPlayer(playerid, Startup2);
    TextDrawHideForPlayer(playerid, Startup3);
    TextDrawHideForPlayer(playerid, Startup4);
    TextDrawHideForPlayer(playerid, Startup5);
    StopAudioStreamForPlayer(playerid);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        // Do something here
        return 1;
    }
    return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}
Thanks but theres a problem. When I login, it does the camera then it goes to class selection like I wanted it! But when I click "Spawn", it doesn't load, it goes to the spawn for less than a second then it goes back to class selection and it keeps happening
Reply
#9

Try removing this line from OnPlayerSpawn:
pawn Код:
TogglePlayerSpectating(playerid, 0);
Reply
#10

Still doesn't work.

I removed
Код:
TogglePlayerSpectating(playerid, 0);
from OnPlayerConnect and when I press Spawn it goes back to Class Selection!

Please help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)