SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 13/08/2018, 06:45 PM   #11
RedRex
Huge Clucker
 
RedRex's Avatar
 
Join Date: Jan 2016
Location: Portugal <3
Posts: 481
Reputation: 29
Default Re: Player color changed every secdon!

I don't think your code will worked! but you are not defined them! So I hope If you following me like you did! To creating a more factions! In same point!

PHP Code:
//In the HIT command add this: 

else if(SWAT(GetPlayerSkin(ID)))
                    {
                        
SetTimerEx("SWATCOLOR"1000true"i"ID);
                        
colorchanged[ID] = COLOR_LIGHTBLUE;
                        return 
1;
                    }

//As you created a civilian and follow all skins by this Then

forward SWATCOLOR(playerid);
public 
SWATCOLOR(playerid)
{
    switch(
colorchanged[playerid])
    {
        case 
COLOR_BLACK:
         {
              
SetPlayerColor(playeridCOLOR_LIGHTBLUE);
            
colorchanged[playerid] = COLOR_LIGHTBLUE;
        }
         case 
COLOR_LIGHTBLUE:
          {
               
SetPlayerColor(playeridCOLOR_BLACK);
            
colorchanged[playerid] = COLOR_BLACK;
          }
    }
    return 
1;
}

//NOTE: Do this and it will be worked! I hope you understand.. 
__________________
Laverton's Cops and Robbers
LCNR Soon
We are working on it. JUST WAIT US!! Soon updating to hosted tap!
RedRex is offline   Reply With Quote
Old 13/08/2018, 11:49 PM   #12
Sew_Sumi
Banned
 
Join Date: Jun 2008
Location: Azerbaijan
Posts: 6,455
Reputation: 525
Default Re: Player color changed every secdon!

Quote:
Originally Posted by Man43 View Post
@Sew_Sumi, IDK I think It's were faster & better! anyway I don't know how to TEAM_COP like this because the tutoirals are not understand me!
It's a lot more simple to fuck over your server by simply skin hacking your skin, and shitting all over your playerbase because your script was so shit that it wasn't tracking teams, just skins...



Seriously, this is TERRIBLE FUCKING PRACTICE.........
Sew_Sumi is offline   Reply With Quote
Old 14/08/2018, 04:45 PM   #13
brauf
Little Clucker
 
brauf's Avatar
 
Join Date: Jul 2018
Location: i live in narnia city Savage: 100%
Posts: 31
Reputation: 17
Default Re: Player color changed every secdon!

I agree with Sew_Sumi. As SA-MP has increased in it's popularity, there have been many more cheats introducted in this game. The player could somehow change their skin and spoof themselves into being another team.

You should try assigning the players to a global array of each team stored.

For example:

PHP Code:
#include <a_samp>

#define TEAM_SWAT 1
#define TEAM_POLICE 2
#define TEAM_ROBBER 3


new gTeam[MAX_PLAYERS]; // player team = gTeam[TEAM_SWAT] which will decode to player team = gTeam[1] (for swat)

CMD:teamswat(playeridparams[])
{
    
gTeam[playerid] = TEAM_SWAT// player's team will == TEAM_SWAT

    
return 1;
}


CMD:killallswat(playeridparams[])
{
    for(new 
iMAX_PLAYERSi++) // loop all players
    
{
        if(
gTeam[i] == TEAM_SWAT// if player'd id == TEAM_SWAT
        
{
            
SetPlayerHealth(i0);
        }
    }

    return 
1;

This is an example how you can use them method rather than checking for skins to depict the player's team.
__________________
[SNIPPET] serverHang

brauf is offline   Reply With Quote
Old 14/08/2018, 05:48 PM   #14
Man43
Huge Clucker
 
Man43's Avatar
 
Join Date: Feb 2017
Posts: 251
Reputation: 0
Default Re: Player color changed every secdon!

Ok I agree with you guys but!! How to defined Them? Example: TEAM_SWAT you are not choosing what is team_swat and for what skins? Right? I'm sorry but I don't understand this teams yet! Because you did TEAM_SWAT How do we know that this IS FOR SKIN ID285? Can you explain?

@Sew_Sumi + @brauf
Man43 is offline   Reply With Quote
Old 14/08/2018, 06:12 PM   #15
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 15,234
Reputation: 3183
Default Re: Player color changed every secdon!

Quote:
Originally Posted by Sew_Sumi View Post
You're better off to use the tick timer as it should be used, and to not simply fire it up when it's needed for such a task as this... There's no doubt other systems you are using that are going to be using tick timers, or could be added to a tick timer to make it less wasteful.
That's the exact opposite of what you should be doing! Start a new timer.
Y_Less is offline   Reply With Quote
Old 14/08/2018, 09:32 PM   #16
Sew_Sumi
Banned
 
Join Date: Jun 2008
Location: Azerbaijan
Posts: 6,455
Reputation: 525
Default Re: Player color changed every secdon!

Quote:
Originally Posted by Man43 View Post
Ok I agree with you guys but!! How to defined Them? Example: TEAM_SWAT you are not choosing what is team_swat and for what skins? Right? I'm sorry but I don't understand this teams yet! Because you did TEAM_SWAT How do we know that this IS FOR SKIN ID285? Can you explain?

@Sew_Sumi + @brauf
You use a gTeam array, and make that track which team the players are in. There should be a few tutorials pop up for team information when you search for gTeam.
Sew_Sumi 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get Player color and change vehicle color to the player color gurmani11 Scripting Help 4 03/07/2015 12:34 PM
how to check if a player's position has been drastically changed? T0pAz Scripting Help 4 11/02/2012 04:42 PM
Detect if player changed skin lukas567 Help Archive 7 20/08/2011 10:51 AM
How to check is player pos has changed? ajwar Help Archive 2 18/02/2011 04:41 PM
Color scheme has been changed error (windows 7) brickT Client Support 4 03/02/2010 08:16 AM


All times are GMT. The time now is 07:42 AM.


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