SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 03/09/2014, 09:14 PM   #11
nightday
Banned
 
Join Date: Aug 2013
Posts: 109
Reputation: 5
Default Re: Bug

what i do now to working all class for color but why there is Commands from class to defince class teaming and colors
but what i do
nightday is offline   Reply With Quote
Old 03/09/2014, 09:43 PM   #12
nightday
Banned
 
Join Date: Aug 2013
Posts: 109
Reputation: 5
Default Re: Bug

any idea to fix colors to its mix !
nightday is offline   Reply With Quote
Old 03/09/2014, 10:19 PM   #13
nightday
Banned
 
Join Date: Aug 2013
Posts: 109
Reputation: 5
Default Re: Bug

Why its not use the Color For Class why the Color Mix with more class ! please help
nightday is offline   Reply With Quote
Old 03/09/2014, 10:58 PM   #14
Rifa4life
Big Clucker
 
Rifa4life's Avatar
 
Join Date: Jul 2012
Location: Rzeczpospolita
Posts: 86
Reputation: 9
Default Re: Bug

I have no idea what you are saying...
Rifa4life is offline   Reply With Quote
Old 03/09/2014, 11:03 PM   #15
nightday
Banned
 
Join Date: Aug 2013
Posts: 109
Reputation: 5
Default Re: Bug

i saying somone have idea
nightday is offline   Reply With Quote
Old 03/09/2014, 11:14 PM   #16
Threshold
High-roller
 
Threshold's Avatar
 
Join Date: Nov 2012
Location: Australia
Posts: 3,126
Reputation: 527
Default Re: Bug

You have your classids mixed up...
pawn Code:
#include <a_samp>

#define COLOR_White     0xFFFFFFFF
#define COLOR_Blue      0x0099FFFF
#define COLOR_Cyan      0x00F0F0FF

// Define the teams so it's easier to use later
#define TEAM_BLUE       1
#define TEAM_WHITE      2
#define TEAM_CYAN       3

// Tracks what team a player is in
new gTeam[MAX_PLAYERS];

main()
{
    print("\n----------------------------------");
    print(" Cops And Robbers");
    print("----------------------------------\n");
}

public OnGameModeInit()
{
    SetGameModeText("Cops And Robbers");
    AddPlayerClass(266, 2303.9497, 2439.0103, 3.2734, 19.1234, 3, 1, 22, 50, 29, 500);      // Blue team
    AddPlayerClass(211, 2303.9497, 2439.0103, 3.2734, 19.1234, 3, 1, 22, 50, 29, 500);      // Blue team
    AddPlayerClass(265, 2303.9497, 2439.0103, 3.2734, 19.1234, 3, 1, 22, 50, 29, 500);      // Blue team
    AddPlayerClass(267, 2303.9497, 2439.0103, 3.2734, 19.1234, 3, 1, 22, 50, 29, 500);      // Blue team
    AddPlayerClass(283, 2303.9497, 2439.0103, 3.2734, 19.1234, 3, 1, 22, 50, 29, 500);      // Blue team
    AddPlayerClass(284, 2303.9497, 2439.0103, 3.2734, 19.1234, 3, 1, 22, 50, 29, 500);      // Blue team
    AddPlayerClass(285, 2303.9497, 2439.0103, 3.2734, 19.1234, 3, 1, 22, 50, 29, 500);      // Cyan team
    AddPlayerClass(71, -1261.6409, 38.9104, 14.1387, 226.4688, 3, 1, 22, 50, 29, 500);      // White team
    AddPlayerClass(50, 2006.1929, 2295.9451, 10.8203, 177.4306, 22, 50, 0, 0, 0, 0);        // White team
    AddPlayerClass(133, 1151.7200, 1399.4144, 5.8203, 0.9030, 22, 50, 0, 0, 0, 0);          // White team
    AddPlayerClass(151, 1151.7200, 1399.4144, 5.8203, 0.9030, 22, 50, 0, 0, 0, 0);          // White team
    AddPlayerClass(12, 2090.1008, 2078.2600, 10.8203, 263.0699, 0, 0, 0, 0, 0, 0);          // White team
    AddPlayerClass(23, 2090.1008, 2078.2600, 10.8203, 263.0699, 0, 0, 0, 0, 0, 0);          // White team
    AddPlayerClass(29, 2815.0498, 2254.1252, 10.8203, 158.6954, 0, 0, 0, 0, 0, 0);          // White team
    AddPlayerClass(294, 2814.0542, 2253.4043, 10.8203, 315.9051, 0, 0, 0, 0, 0, 0);         // White team
    AddPlayerClass(214, 2812.1963, 2247.7256, 10.8203, 352.8735, 0, 0, 0, 0, 0, 0);         // White team
    AddPlayerClass(1, 2634.0793, 1072.6293, 10.8203, 88.4012, 0, 0, 0, 0, 0, 0);            // White team
    AddPlayerClass(15, 2634.0793, 1072.6293, 10.8203, 88.4012, 0, 0, 0, 0, 0, 0);           // White team
    AddPlayerClass(34, 2634.0793, 1072.6293, 10.8203, 88.4012, 0, 0, 0, 0, 0, 0);           // White team
    AddPlayerClass(2, 2193.6528, 2007.7402, 12.2894, 1.8574, 0, 0, 0, 0, 0, 0);             // White team
    AddPlayerClass(9, 2193.6528, 2007.7402, 12.2894, 1.8574, 0, 0, 0, 0, 0, 0);             // White team
    AddPlayerClass(19, 2193.6528, 2007.7402, 12.2894, 1.8574, 0, 0, 0, 0, 0, 0);            // White team
    AddPlayerClass(22, 2193.6528, 2007.7402, 12.2894, 1.8574, 0, 0, 0, 0, 0, 0);            // White team
    AddPlayerClass(26, 2082.0784, 2480.8333, 10.8203, 182.0390, 0, 0, 0, 0, 0, 0);          // White team
    AddPlayerClass(31, 2082.0784, 2480.8333, 10.8203, 182.0390, 0, 0, 0, 0, 0, 0);          // White team
    AddPlayerClass(45, 2082.0784, 2480.8333, 10.8203, 182.0390, 0, 0, 0, 0, 0, 0);          // White team
    AddPlayerClass(46, 2082.0784, 2480.8333, 10.8203, 182.0390, 0, 0, 0, 0, 0, 0);          // White team
    AddPlayerClass(9, 2193.7366, 2007.4865, 12.2894, 358.2378, 0, 0, 0, 0, 0, 0);           // White team
    AddPlayerClass(13, 2193.7366, 2007.4865, 12.2894, 358.2378, 0, 0, 0, 0, 0, 0);          // White team
    AddPlayerClass(14, 2193.7366, 2007.4865, 12.2894, 358.2378, 0, 0, 0, 0, 0, 0);          // White team
    AddPlayerClass(24, 2193.7366, 2007.4865, 12.2894, 358.2378, 0, 0, 0, 0, 0, 0);          // White team
    AddPlayerClass(33, 2193.7366, 2007.4865, 12.2894, 358.2378, 0, 0, 0, 0, 0, 0);          // White team
    AddPlayerClass(36, 2193.7366, 2007.4865, 12.2894, 358.2378, 0, 0, 0, 0, 0, 0);          // White team
    AddPlayerClass(38, 2193.7366, 2007.4865, 12.2894, 358.2378, 0, 0, 0, 0, 0, 0);          // White team
    AddPlayerClass(160, 2193.7366, 2007.4865, 12.2894, 358.2378, 0, 0, 0, 0, 0, 0);         // White team
    AddPlayerClass(82, 2193.7366, 2007.4865, 12.2894, 358.2378, 0, 0, 0, 0, 0, 0);          // White team
    AddPlayerClass(107, 2193.7366, 2007.4865, 12.2894, 358.2378, 0, 0, 0, 0, 0, 0);         // White team
    AddPlayerClass(59, 2193.7366, 2007.4865, 12.2894, 358.2378, 0, 0, 0, 0, 0, 0);          // White team
    AddPlayerClass(127, 2193.7366, 2007.4865, 12.2894, 358.2378, 0, 0, 0, 0, 0, 0);         // White team
    AddPlayerClass(128, 2193.7366, 2007.4865, 12.2894, 358.2378, 0, 0, 0, 0, 0, 0);         // White team
    AddPlayerClass(138, 2193.7366, 2007.4865, 12.2894, 358.2378, 0, 0, 0, 0, 0, 0);         // White team
    AddPlayerClass(28, 2193.7366, 2007.4865, 12.2894, 358.2378, 0, 0, 0, 0, 0, 0);          // White team
    AddPlayerClass(147, 2193.7366, 2007.4865, 12.2894, 358.2378, 0, 0, 0, 0, 0, 0);         // White team
    AddPlayerClass(299, 2193.7366, 2007.4865, 12.2894, 358.2378, 0, 0, 0, 0, 0, 0);         // White team
    AddPlayerClass(123, 2193.7366, 2007.4865, 12.2894, 358.2378, 0, 0, 0, 0, 0, 0);         // White team
    AddPlayerClass(204, 2193.7366, 2007.4865, 12.2894, 358.2378, 0, 0, 0, 0, 0, 0);         // White team
    AddPlayerClass(249, 2193.7366, 2007.4865, 12.2894, 358.2378, 15, 1, 15, 500, 28, 500);  // White team
    AddPlayerClass(264, 2193.7366, 2007.4865, 12.2894, 358.2378, 0, 0, 0, 0, 0, 0);         // White team
    AddPlayerClass(269, 2193.7366, 2007.4865, 12.2894, 358.2378, 0, 0, 0, 0, 0, 0);         // White team
    AddPlayerClass(270, 2193.7366, 2007.4865, 12.2894, 358.2378, 0, 0, 0, 0, 0, 0);         // White team
    AddPlayerClass(293, 2193.5884, 2007.4149, 12.2894, 355.9373, 0, 0, 0, 0, 0, 0);         // White team
    AddPlayerClass(271, 2193.7366, 2007.4865, 12.2894, 358.2378, 0, 0, 0, 0, 0, 0);         // White team
    AddPlayerClass(298, 2193.5884, 2007.4149, 12.2894, 355.9373, 0, 0, 0, 0, 0, 0);         // White team
    AddPlayerClass(137, 2193.5884, 2007.4149, 12.2894, 355.9373, 0, 0, 0, 0, 0, 0);         // White team
    return 1;
}

public OnPlayerConnect(playerid)
{
    OnPlayerRequestClass(playerid, 0);
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerTeamFromClass(playerid, classid);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerToTeamColour(playerid); // calls the custom function
    return 1;
}

SetPlayerTeamFromClass(playerid, classid)
{
    switch(classid)
    {
        case 0 .. 5: gTeam[playerid] = TEAM_BLUE;
        case 6: gTeam[playerid] = TEAM_CYAN;
        default: gTeam[playerid] = TEAM_WHITE;
    }
    return 1;
}

SetPlayerToTeamColour(playerid)
{
    switch(gTeam[playerid])
    {
        case TEAM_BLUE: SetPlayerColor(playerid, COLOR_Blue);
        case TEAM_CYAN: SetPlayerColor(playerid, COLOR_Cyan);
        case TEAM_WHITE: SetPlayerColor(playerid, COLOR_White);
        default: Kick(playerid);
    }
    return 1;
}

So you decided to make your own CnR server NightDay? Good for you...


EDIT:
You also may want to include the following functions in your OnPlayerRequestClass:
http://wiki.sa-mp.com/wiki/SetPlayerCameraPos
http://wiki.sa-mp.com/wiki/SetPlayerCameraLookAt
http://wiki.sa-mp.com/wiki/SetPlayerPos
http://wiki.sa-mp.com/wiki/SetPlayerFacingAngle
__________________

Kar's Cops and Robbers 2019
Threshold is offline   Reply With Quote
Old 03/09/2014, 11:26 PM   #17
nightday
Banned
 
Join Date: Aug 2013
Posts: 109
Reputation: 5
Default Re: Bug

Lol its my frist to make it gteam and its esey to make commands but thanks, Threshold
nightday is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 12:29 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.