SA-MP Forums

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

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

Bug Showing Player Team Withe its Color Withe Showing it Blue Lol And Color Blue its Cyan And Color Cyan Blue any one can help me
PHP Code:
#include <a_samp>
#define COLOR_Withe 0xFFFFFF
#define COLOR_Blue 0x0099FF
#define COLOR_Cyan 0x99FFFF
// Define the teams so its easier to use later
#define TEAM_BLUE 1

#define TEAM_Withe 2

#define TEAM_Cyan 3
// Define the colours you want each team to be, its easier for later on
#define TEAM_BLUE_COLOUR 0x0099FF // blue duh

#define TEAM_Withe_COLOUR 0xFFFFFF // Withe duh

#define TEAM_Cyan_COLOUR 0x99FFFF // Cyan duh

// 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); // Withe team
AddPlayerClass(50,2006.1929,2295.9451,10.8203,177.4306,22,50,0,0,0,0); // Withe team
AddPlayerClass(133,1151.7200,1399.4144,5.8203,0.9030,22,50,0,0,0,0); // Withe team
AddPlayerClass(151,1151.7200,1399.4144,5.8203,0.9030,22,50,0,0,0,0); // Withe team
AddPlayerClass(12,2090.1008,2078.2600,10.8203,263.0699,0,0,0,0,0,0); // Withe team
AddPlayerClass(23,2090.1008,2078.2600,10.8203,263.0699,0,0,0,0,0,0); // Withe team
AddPlayerClass(29,2815.0498,2254.1252,10.8203,158.6954,0,0,0,0,0,0); // Withe team
AddPlayerClass(294,2814.0542,2253.4043,10.8203,315.9051,0,0,0,0,0,0); // Withe team
AddPlayerClass(214,2812.1963,2247.7256,10.8203,352.8735,0,0,0,0,0,0); // Withe team
AddPlayerClass(1,2634.0793,1072.6293,10.8203,88.4012,0,0,0,0,0,0); // Withe team
AddPlayerClass(15,2634.0793,1072.6293,10.8203,88.4012,0,0,0,0,0,0); // Withe team
AddPlayerClass(34,2634.0793,1072.6293,10.8203,88.4012,0,0,0,0,0,0); // Withe team
AddPlayerClass(2,2193.6528,2007.7402,12.2894,1.8574,0,0,0,0,0,0); // Withe team
AddPlayerClass(9,2193.6528,2007.7402,12.2894,1.8574,0,0,0,0,0,0); // Withe team
AddPlayerClass(19,2193.6528,2007.7402,12.2894,1.8574,0,0,0,0,0,0); // Withe team
AddPlayerClass(22,2193.6528,2007.7402,12.2894,1.8574,0,0,0,0,0,0); // Withe team
AddPlayerClass(26,2082.0784,2480.8333,10.8203,182.0390,0,0,0,0,0,0); // Withe team
AddPlayerClass(31,2082.0784,2480.8333,10.8203,182.0390,0,0,0,0,0,0); // Withe team
AddPlayerClass(45,2082.0784,2480.8333,10.8203,182.0390,0,0,0,0,0,0); // Withe team
AddPlayerClass(46,2082.0784,2480.8333,10.8203,182.0390,0,0,0,0,0,0); // Withe team
AddPlayerClass(9,2193.7366,2007.4865,12.2894,358.2378,0,0,0,0,0,0); // Withe team
AddPlayerClass(13,2193.7366,2007.4865,12.2894,358.2378,0,0,0,0,0,0); // Withe team
AddPlayerClass(14,2193.7366,2007.4865,12.2894,358.2378,0,0,0,0,0,0); // Withe team
AddPlayerClass(24,2193.7366,2007.4865,12.2894,358.2378,0,0,0,0,0,0); // Withe team
AddPlayerClass(33,2193.7366,2007.4865,12.2894,358.2378,0,0,0,0,0,0); // Withe team
AddPlayerClass(36,2193.7366,2007.4865,12.2894,358.2378,0,0,0,0,0,0); // Withe team
AddPlayerClass(38,2193.7366,2007.4865,12.2894,358.2378,0,0,0,0,0,0); // Withe team
AddPlayerClass(160,2193.7366,2007.4865,12.2894,358.2378,0,0,0,0,0,0); // Withe team
AddPlayerClass(82,2193.7366,2007.4865,12.2894,358.2378,0,0,0,0,0,0); // Withe team
AddPlayerClass(107,2193.7366,2007.4865,12.2894,358.2378,0,0,0,0,0,0); // Withe team
AddPlayerClass(59,2193.7366,2007.4865,12.2894,358.2378,0,0,0,0,0,0); // Withe team
AddPlayerClass(127,2193.7366,2007.4865,12.2894,358.2378,0,0,0,0,0,0); // Withe team
AddPlayerClass(128,2193.7366,2007.4865,12.2894,358.2378,0,0,0,0,0,0); // Withe team
AddPlayerClass(138,2193.7366,2007.4865,12.2894,358.2378,0,0,0,0,0,0); // Withe team
AddPlayerClass(28,2193.7366,2007.4865,12.2894,358.2378,0,0,0,0,0,0); // Withe team
AddPlayerClass(147,2193.7366,2007.4865,12.2894,358.2378,0,0,0,0,0,0); // Withe team
AddPlayerClass(299,2193.7366,2007.4865,12.2894,358.2378,0,0,0,0,0,0); // Withe team
AddPlayerClass(123,2193.7366,2007.4865,12.2894,358.2378,0,0,0,0,0,0); // Withe team
AddPlayerClass(204,2193.7366,2007.4865,12.2894,358.2378,0,0,0,0,0,0); // Withe team
AddPlayerClass(249,2193.7366,2007.4865,12.2894,358.2378,15,1,15,500,28,500); // Withe team
AddPlayerClass(264,2193.7366,2007.4865,12.2894,358.2378,0,0,0,0,0,0); // Withe team
AddPlayerClass(269,2193.7366,2007.4865,12.2894,358.2378,0,0,0,0,0,0); // Withe team
AddPlayerClass(270,2193.7366,2007.4865,12.2894,358.2378,0,0,0,0,0,0); // Withe team
AddPlayerClass(293,2193.5884,2007.4149,12.2894,355.9373,0,0,0,0,0,0); // Withe team
AddPlayerClass(271,2193.7366,2007.4865,12.2894,358.2378,0,0,0,0,0,0); // Withe team
AddPlayerClass(298,2193.5884,2007.4149,12.2894,355.9373,0,0,0,0,0,0); // Withe team
AddPlayerClass(137,2193.5884,2007.4149,12.2894,355.9373,0,0,0,0,0,0); // Withe team 
PHP Code:
public OnPlayerRequestClass(playeridclassid)
{
    
SetPlayerTeamFromClass(playeridclassid); // calls the custom function
    
return 1;
}

public 
OnPlayerSpawn(playerid)
{
    
SetPlayerToTeamColour(playerid); // calls the custom function
    
return 1;
}
forward SetPlayerTeamFromClass(playeridclassid);
public 
SetPlayerTeamFromClass(playeridclassid)
{
    if(
classid == 0)
    {
        
gTeam[playerid] = TEAM_BLUE// using the defines at the top
    
}
    else if(
classid == 1)
    {
        
gTeam[playerid] = TEAM_Withe// same ^^
    
}
    else if(
classid == 3)
    {
        
gTeam[playerid] = TEAM_Cyan// same ^^
    
}

}


forward SetPlayerToTeamColour(playerid);
public 
SetPlayerToTeamColour(playerid)
{
    if(
gTeam[playerid] == TEAM_BLUE)
    {
        
SetPlayerColor(playerid,TEAM_BLUE_COLOUR); // Blue
    
}
    else if(
gTeam[playerid] == TEAM_Withe)
    {
        
SetPlayerColor(playerid,TEAM_Withe_COLOUR); // Withe
    
}
    else if(
gTeam[playerid] == TEAM_Cyan)
    {
        
SetPlayerColor(playerid,TEAM_Cyan_COLOUR); // Cyan
    
}

    return 
1;

nightday is offline   Reply With Quote
Old 03/09/2014, 06:25 PM   #2
HyDrAtIc
High-roller
 
Join Date: Jan 2012
Posts: 1,189
Reputation: 233
Default Re: Bug

Can you use ****** translator, please?

I only understood blue and white..
__________________
Back to service, unbanned.
HyDrAtIc is offline   Reply With Quote
Old 03/09/2014, 06:30 PM   #3
Stinged
High-roller
 
Join Date: Feb 2013
Posts: 1,571
Reputation: 187
Default Re: Bug

You're not adding alpha (transparency)
How your colors look: 0x000000
How they should look: 0x000000(00-99-AA-FF)

Note: It's white not withe
Stinged is offline   Reply With Quote
Old 03/09/2014, 06:38 PM   #4
LeroyII
Big Clucker
 
LeroyII's Avatar
 
Join Date: Aug 2014
Posts: 116
Reputation: 7
Default Re: Bug

Why don't you just simply use exsisting fs? I mean how many theards did you posted already about this? You can get it done in few minutes lol
__________________
LeroyII is offline   Reply With Quote
Old 03/09/2014, 06:39 PM   #5
nightday
Banned
 
Join Date: Aug 2013
Posts: 109
Reputation: 5
Default Re: Bug

How to fix i get it in wiki color see http://www.nthelp.com/colorcodes.htm
what i do to fix lol i get it from wiki and mistake what i do now
nightday is offline   Reply With Quote
Old 03/09/2014, 06:54 PM   #6
Stinged
High-roller
 
Join Date: Feb 2013
Posts: 1,571
Reputation: 187
Default Re: Bug

What's so hard about understanding my post.
Stinged is offline   Reply With Quote
Old 03/09/2014, 07:22 PM   #7
Rifa4life
Big Clucker
 
Rifa4life's Avatar
 
Join Date: Jul 2012
Location: Rzeczpospolita
Posts: 86
Reputation: 9
Default Re: Bug

For colours, as Stinged correctly said, you have to use the following format:

0x | RR | GG | BB | AA

Alpha is transparency, you don't need to worry about that. Basically, you use standard HEX, but add 0x at the beginning and (in your case) FF at the end.
Rifa4life is offline   Reply With Quote
Old 03/09/2014, 08:28 PM   #8
nightday
Banned
 
Join Date: Aug 2013
Posts: 109
Reputation: 5
Default Re: Bug

Quote:
Originally Posted by Stinged View Post
What's so hard about understanding my post.
yes i dont know u are now what i get from my head the color and i try to get withe or what and im new
nightday is offline   Reply With Quote
Old 03/09/2014, 08:52 PM   #9
nightday
Banned
 
Join Date: Aug 2013
Posts: 109
Reputation: 5
Default Re: Bug

i Get The 3 Colors White And Cyan And Blue and the skins mix up from Colors i make 5 Cops Color Blue And i Make Much Skin White And i Make 1 only Skin Color Cyan But its Mixup from there White Skin its Cyan Skins And Cops its Now Blue And White lol
what i do now to i fix teaming color to all mixed up and i defince color why its mix ?
PHP Code:
#include <a_samp>
#define COLOR_White 0x00FFFF
#define COLOR_Blue 0x33FFFF
#define COLOR_Cyan 0xFFFFFF
// Define the teams so its easier to use later
#define TEAM_BLUE 1

#define TEAM_White 2

#define TEAM_Cyan 3
// Define the colours you want each team to be, its easier for later on
#define TEAM_White_COLOUR 0xFFFFFFAA // White duh

#define TEAM_BLUE_COLOUR 0x33FFFF // blue duh


#define TEAM_Cyan_COLOUR 0xFFFFFF // Cyan duh

// Tracks what team a player is in
new gTeam[MAX_PLAYERS]; 
PHP Code:
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 
PHP Code:
public OnPlayerRequestClass(playeridclassid)
{
    
SetPlayerTeamFromClass(playeridclassid); // calls the custom function
    
return 1;
}

public 
OnPlayerSpawn(playerid)
{
    
SetPlayerToTeamColour(playerid); // calls the custom function
    
return 1;
}
forward SetPlayerTeamFromClass(playeridclassid);
public 
SetPlayerTeamFromClass(playeridclassid)
{
    if(
classid == 0)
    {
        
gTeam[playerid] = TEAM_BLUE// using the defines at the top
    
}
    else if(
classid == 1)
    {
        
gTeam[playerid] = TEAM_White// same ^^
    
}
    else if(
classid == 3)
    {
        
gTeam[playerid] = TEAM_Cyan// same ^^
    
}

}


forward SetPlayerToTeamColour(playerid);
public 
SetPlayerToTeamColour(playerid)
{
    if(
gTeam[playerid] == TEAM_BLUE)
    {
        
SetPlayerColor(playerid,TEAM_BLUE_COLOUR); // Blue
    
}
    else if(
gTeam[playerid] == TEAM_White)
    {
        
SetPlayerColor(playerid,TEAM_White_COLOUR); // Withe
    
}
    else if(
gTeam[playerid] == TEAM_Cyan)
    {
        
SetPlayerColor(playerid,TEAM_Cyan_COLOUR); // Cyan
    
}

    return 
1;

nightday is offline   Reply With Quote
Old 03/09/2014, 09:05 PM   #10
Stinged
High-roller
 
Join Date: Feb 2013
Posts: 1,571
Reputation: 187
Default Re: Bug

You have A LOT of classes, and you're only checking for 3. How did you think that will work..
Stinged 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 11:52 AM.


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