#1

con somebody please find/make a filterscript which allows me t0 set a player color and save it for every time they connect to my server?

credits will be kept in place
Reply
#2

This should really be made in the Script request thread. But I have a command which will chnage your color. You can have it. This is doen Via a menu.

pawn Код:
new Menu:ColorMenu;


pawn Код:
//The Command
if (strcmp("/color", cmdtext, true, 10) == 0)
{
ShowMenuForPlayer(ColorMenu, playerid);
TogglePlayerControllable(playerid, false);
return 1;
}
pawn Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
  new Menu:current;
  current = GetPlayerMenu(playerid);
  HideMenuForPlayer(ColorMenu, playerid);
    if(current == ColorMenu)
  {
    switch(row)
    {
      case 0:
            {
            SetPlayerColor(playerid, COLOR_GREEN);
            TogglePlayerControllable(playerid, true);
            }
            case 1:
            {
            SetPlayerColor(playerid, COLOR_LIME);
            TogglePlayerControllable(playerid, true);
            }
      case 2:
            {
            SetPlayerColor(playerid, COLOR_BLUE);
      TogglePlayerControllable(playerid, true);
      }
      case 3:
            {
            SetPlayerColor(playerid, COLOR_YELLOW);
      TogglePlayerControllable(playerid, true);
      }
      case 4:
            {
            SetPlayerColor(playerid, COLOR_ORANGE);
      TogglePlayerControllable(playerid, true);
      }
      case 5:
            {
            SetPlayerColor(playerid, COLOR_GREY);
      TogglePlayerControllable(playerid, true);
      }
      case 6:
            {
            SetPlayerColor(playerid, COLOR_PINK);
      TogglePlayerControllable(playerid, true);
      }
      case 7:
            {
            SetPlayerColor(playerid, COLOR_PURPLE);
      TogglePlayerControllable(playerid, true);
      }
      case 8:
            {
            SetPlayerColor(playerid, COLOR_LIGHTBLUE);
      TogglePlayerControllable(playerid, true);
      }
      case 9:
            {
            SetPlayerColor(playerid, COLOR_BLACK);
      TogglePlayerControllable(playerid, true);
      }
      case 10:
            {
            SetPlayerColor(playerid, COLOR_BROWN);
      TogglePlayerControllable(playerid, true);
      }
      case 11:
            {
            SetPlayerColor(playerid, COLOR_WHITE);
      TogglePlayerControllable(playerid, true);
      }
        }
    }
}
    return 1;
}
pawn Код:
ColorMenu = CreateMenu("Color Menu", 1, 50.0, 180.0, 200.0, 200.0);

    AddMenuItem(ColorMenu, 0, "Green");
    AddMenuItem(ColorMenu, 0, "Lime");
    AddMenuItem(ColorMenu, 0, "Blue");
    AddMenuItem(ColorMenu, 0, "Yellow");
    AddMenuItem(ColorMenu, 0, "Orange");
    AddMenuItem(ColorMenu, 0, "Grey");
    AddMenuItem(ColorMenu, 0, "Pink");
    AddMenuItem(ColorMenu, 0, "Purple");
    AddMenuItem(ColorMenu, 0, "Lightblue");
  AddMenuItem(ColorMenu, 0, "Black");
    AddMenuItem(ColorMenu, 0, "Brown");
    AddMenuItem(ColorMenu, 0, "White");
Will work perfectly if you put it in your code properly.
Reply
#3

Dont forget the AddMenuItem code.
Reply
#4

er im not sure if dini or one of those saves color hex's or wev but
you could try saving the players color by doing the getplayercolor function (i think thats what its called)
and then saving it to a file, then when they connect onplayerconnect it would do setplayercolor and the hex code which would get retrived from the file you saved earlier

sorry if that didnt make any sense lolol
Reply
#5

Quote:
Originally Posted by Klutty
Dont forget the AddMenuItem code.
Oh yes, I forgot about that. Added ot my post. Thanks Klutty! :P

Quote:
Originally Posted by iLinx
er im not sure if dini or one of those saves color hex's or wev but
you could try saving the players color by doing the getplayercolor function (i think thats what its called)
and then saving it to a file, then when they connect onplayerconnect it would do setplayercolor and the hex code which would get retrived from the file you saved earlier

sorry if that didnt make any sense lolol
I think I understand what you mean. Like it stores Score, or money, but use it for color? Nice thought.
Reply
#6

Quote:
Originally Posted by Burridge
This should really be made in the Script request thread. But I have a command which will chnage your color. You can have it. This is doen Via a menu.

pawn Код:
new Menu:ColorMenu;


pawn Код:
//The Command
if (strcmp("/color", cmdtext, true, 10) == 0)
{
ShowMenuForPlayer(ColorMenu, playerid);
TogglePlayerControllable(playerid, false);
return 1;
}
pawn Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
  new Menu:current;
  current = GetPlayerMenu(playerid);
  HideMenuForPlayer(ColorMenu, playerid);
    if(current == ColorMenu)
  {
    switch(row)
    {
      case 0:
            {
            SetPlayerColor(playerid, COLOR_GREEN);
            TogglePlayerControllable(playerid, true);
            }
            case 1:
            {
            SetPlayerColor(playerid, COLOR_LIME);
            TogglePlayerControllable(playerid, true);
            }
      case 2:
            {
            SetPlayerColor(playerid, COLOR_BLUE);
      TogglePlayerControllable(playerid, true);
      }
      case 3:
            {
            SetPlayerColor(playerid, COLOR_YELLOW);
      TogglePlayerControllable(playerid, true);
      }
      case 4:
            {
            SetPlayerColor(playerid, COLOR_ORANGE);
      TogglePlayerControllable(playerid, true);
      }
      case 5:
            {
            SetPlayerColor(playerid, COLOR_GREY);
      TogglePlayerControllable(playerid, true);
      }
      case 6:
            {
            SetPlayerColor(playerid, COLOR_PINK);
      TogglePlayerControllable(playerid, true);
      }
      case 7:
            {
            SetPlayerColor(playerid, COLOR_PURPLE);
      TogglePlayerControllable(playerid, true);
      }
      case 8:
            {
            SetPlayerColor(playerid, COLOR_LIGHTBLUE);
      TogglePlayerControllable(playerid, true);
      }
      case 9:
            {
            SetPlayerColor(playerid, COLOR_BLACK);
      TogglePlayerControllable(playerid, true);
      }
      case 10:
            {
            SetPlayerColor(playerid, COLOR_BROWN);
      TogglePlayerControllable(playerid, true);
      }
      case 11:
            {
            SetPlayerColor(playerid, COLOR_WHITE);
      TogglePlayerControllable(playerid, true);
      }
        }
    }
}
    return 1;
}
pawn Код:
ColorMenu = CreateMenu("Color Menu", 1, 50.0, 180.0, 200.0, 200.0);

    AddMenuItem(ColorMenu, 0, "Green");
    AddMenuItem(ColorMenu, 0, "Lime");
    AddMenuItem(ColorMenu, 0, "Blue");
    AddMenuItem(ColorMenu, 0, "Yellow");
    AddMenuItem(ColorMenu, 0, "Orange");
    AddMenuItem(ColorMenu, 0, "Grey");
    AddMenuItem(ColorMenu, 0, "Pink");
    AddMenuItem(ColorMenu, 0, "Purple");
    AddMenuItem(ColorMenu, 0, "Lightblue");
  AddMenuItem(ColorMenu, 0, "Black");
    AddMenuItem(ColorMenu, 0, "Brown");
    AddMenuItem(ColorMenu, 0, "White");
Will work perfectly if you put it in your code properly.
ok thanks alot, where do i put the last bit of it

i have done the new //at the top

and the onplayercommandtext //duh

but where does the addmenuitem code go?

thanks
Reply
#7

Under "OnGameModeInit"
Reply
#8

Quote:
Originally Posted by Burridge
Under "OnGameModeInit"
thanks
Reply
#9

WTF?

Код:
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(642) : warning 217: loose indentation
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(710) : warning 217: loose indentation
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(716) : error 017: undefined symbol "COLOR_GREEN"
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(721) : error 017: undefined symbol "COLOR_LIME"
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(726) : error 017: undefined symbol "COLOR_BLUE"
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(727) : warning 217: loose indentation
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(731) : error 017: undefined symbol "COLOR_YELLOW"
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(732) : warning 217: loose indentation
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(736) : error 017: undefined symbol "COLOR_ORANGE"
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(737) : warning 217: loose indentation
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(741) : error 017: undefined symbol "COLOR_GREY"
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(742) : warning 217: loose indentation
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(746) : error 017: undefined symbol "COLOR_PINK"
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(747) : warning 217: loose indentation
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(751) : error 017: undefined symbol "COLOR_PURPLE"
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(752) : warning 217: loose indentation
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(756) : error 017: undefined symbol "COLOR_LIGHTBLUE"
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(757) : warning 217: loose indentation
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(761) : error 017: undefined symbol "COLOR_BLACK"
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(762) : warning 217: loose indentation
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(766) : error 017: undefined symbol "COLOR_BROWN"
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(767) : warning 217: loose indentation
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(771) : error 017: undefined symbol "COLOR_WHITE"
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(772) : warning 217: loose indentation
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\gamemodes\start.pwn(777) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
Reply
#10

pawn Код:
#define GREEN       0x21DD00FF
#define RED         0xE60000FF
#define COLOR_ADMINISTRATOR     0xFB0000FF
#define YELLOW      0xFFFF00FF
#define ORANGE      0xF97804FF
#define LIGHTRED    0xFF8080FF
#define LIGHTBLUE   0x00C2ECFF
#define PURPLE      0xB360FDFF
#define BLUE        0x1229FAFF
#define LIGHTGREEN  0x38FF06FF
#define DARKRED 0xE100E1FF
#define DARKGREEN   0x008040FF
#define AQUAGREEN   0x00CACAFB
#define NICESKY     0x99FFFFAA
#define COLOR_GREY      0xCECECEFF
#define COLOR_WHITE         0xFFFFFFFF
#define COLOR_SYSTEM 0xF5FF9FAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define PINK 0xFF66FFAA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_LIGHTRED      0xFF6347AA
#define COLOR_LIGHTGREEN    0x9ACD32AA
#define COLOR_GRAD1 0xB4B5B7FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_FADE1 0xE6E6E6E6
#define COLOR_FADE2 0xC8C8C8C8
#define COLOR_FADE3 0xAAAAAAAA
#define COLOR_FADE4 0x8C8C8C8C
#define COLOR_FADE5 0x6E6E6E6E
#define WHITE 0xFFFFFFFF
#define COLOR_BRIGHTRED 0xE60000FF
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_BROWN 0x993300AA
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_LIME 0x99FF00AA
#define COLOR_BLACK 0x000000AA
The color's are in there. Use them all if you want.

The lose identifications can be fixed by adding the following line.

pawn Код:
#pragma tabsize 0
Although i recomment you just indent it. Instead of useing that line. Otherwise you'll let all your code go messy.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)