[HELP] Spawn colours
#1

Hello, I have a question. I have a number of different spawn areas. But I still spawn the standard color nicks. Well my question is, how can I change that. Suppose I want the 3 skins in the ballpark in San Fiero a dark purple nick name given. And that example, the 3 racers (the race skins) get a red nick name. and so on. Well my question is how I do.

Thanks.
Reply
#2

https://sampwiki.blast.hk/wiki/How_to_make_spawn_colors
Reply
#3

ahh I think I understand but what does pwn code example that I referred to the baseball field with 3 skins?
Reply
#4

inside OnPlayerSpawn(playerid)
use:
pawn Код:
switch(GetPlayerSkinID(playerid))
{
case /* first class i.e. skin id */: { SetPlayerColour(playerid, /*color code for first skin class */); }
case /* second class */: { SetPlayerColour(playerid, /*color code for first second class */); }
case /* third class */: { SetPlayerColour(playerid, /*color code for first third class */); }
}
EDIT:fixed
Reply
#5

ahh oke thank you all i gonna try it i give ya all +rep
thx
Reply
#6

* edited upper post *

> there is also a better way to do this <
Reply
#7

i got 4 errors namely:

Quote:

C:\Users\Edward\Desktop\sa-mp legendary planet\pawno\lpgamemode2.pwn(1326) : error 017: undefined symbol "pClass"
C:\Users\Edward\Desktop\sa-mp legendary planet\pawno\lpgamemode2.pwn(1326) : error 029: invalid expression, assumed zero
C:\Users\Edward\Desktop\sa-mp legendary planet\pawno\lpgamemode2.pwn(1326) : error 029: invalid expression, assumed zero
C:\Users\Edward\Desktop\sa-mp legendary planet\pawno\lpgamemode2.pwn(1326) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

this is my pwn code:

Quote:

public OnPlayerSpawn(playerid)
{
// First we need to determine what classid a player spawned with
switch(pClass[playerid])
{
case 0:
{
// If the player's class is 0 then set it to Orange
SetPlayerColor(playerid, 0x800080AA); // purple
}
case 1:
{
// If the player's class is 1 then set it to Red
SetPlayerColor(playerid, 0xFF9900AA); // orange
}
case 2:
{
// If the player's class is 0 then set it to Orange
SetPlayerColor(playerid, 0xAA3333AA); // red


}
return 1;
}

Reply
#8

pClass[playerid]
need to be defined first -__-
so at top above the script add this
Код:
new pClass[MAX_PLAYERS] ;
and in OnPlayerSpawn(playerid)
use
pawn Код:
public OnPlayerSpawn(playerid)
{
// First we need to determine what classid a player spawned with
    pClass[playerid] = GetPlayerSkin(playerid); // this get his skin -__- or instead of using it here use it inside OnPlayerRequestClass { pClass[playerid] = classid }
    switch(pClass[playerid])
    {
        case 0: // replace 0 with skin ID for first class
        {
          // If the player's class is 0 then set it to Orange
          SetPlayerColor(playerid, 0x800080AA); // purple
        }
        case 1: // replace 1 with skin ID for first class
        {
          // If the player's class is 1 then set it to Red
          SetPlayerColor(playerid, 0xFF9900AA); // orange
        }
        case 2: // replace 2 with skin ID for first class
        {
         // If the player's class is 0 then set it to Orange
          SetPlayerColor(playerid, 0xAA3333AA); // red
        }
    }
  return 1;
}
Reply
#9

Fixed, thx

[EDIT]:
It didnt works, when i go ingame in first class i didnt have a purple nickname,
i got 0 warnings and 0 errors
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)