Color.
#1

Well, on S.W.A.T server player colors are red, blue, but on map icon didnt showing. so, what func i should use, to do this?

EX: My team is yakuza, and my color is red. But when i spawn, on MAP players cant see my red icon.
Reply
#2

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

Im should use
SetPlayerMarkerForPlayer( playerid, IM DONT KNOW, BLUE);
SetPlayerMarkerForPlayer( playerid, IM DONT KNOW, RED);
SetPlayerMarkerForPlayer( playerid, IM DONT KNOW, YELLOW);
SetPlayerMarkerForPlayer( playerid, IM DONT KNOW, WHITE); ?
Reply
#4

Can you give me the part where you set the player's team? Then I will make it for you.
Reply
#5

Quote:

//===========================[Komandos]===========================================
SetPlayerTeamFromClass(playerid, classid)
{
if(classid == 0 || classid == 1 || classid == 2) // Patikrinam, ar tikrai tas skinas.
{
ZaidejoKomanda[playerid] = Yakuza; // Nustatom komandа б Yakuza
} // Uюdarom Yakuza nustatymа
if(classid == 3 || classid == 4 || classid == 5) // Patikrinam, ar tikrai tas skinas.
{
ZaidejoKomanda[playerid] = Nostra; // Nustatom komandа б La Cosa Nostra
} // Uюdarom La Cosa Nostra nustatymа
if(classid == 6 || classid == 7 || classid == // Patikrinam, ar tikrai tas skinas.
{
ZaidejoKomanda[playerid] = Policija; // Komanda nusistato б Policijа
} // Uюdarom Policijos nustatymа
if(classid == 9 || classid == 10 || classid == 11) // Patikrinam, ar tikrai tas skinas.
{
ZaidejoKomanda[playerid] = Triads; // Komanda nusistato б Triads
} // Uюdarom Triads nustatymа
} // Uюdarom Callbackа
//===========================[Spalvos]===========================================
SetPlayerToTeamColour(playerid) // Funkcija
{ // Atidarymas
if(IsPlayerNPC(playerid)) return 1; // Jei юaidлjas NPC - nieko jam nedarom
new Vardaz[MAX_PLAYER_NAME]; // Vardo gavimo kintamasis
GetPlayerName(playerid,Vardaz,sizeof(Vardaz)); // Gauna юaidлjo vardа
new mess[65]; // String
if(ZaidejoKomanda[playerid] == Yakuza) // Patikrinam, ar юaidлjas yra Yakuza komandoje.
{ // Atidarom funkcijа
SetPlayerColor(playerid,ySpalva); // Mлlyna
SetPlayerHealth(playerid, 100); // Gyvybлs
SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 0); // Nustatom Deagle skill lygб б 0
SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, 0); // Nustatom MP5 skill lygб б 0
SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 0); // Nustatom AK-47 skill lygб б 0
SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, 0); // Nustatom Shotgun skill lygб б 0
format(mess,sizeof(mess),"GangWars: %s бstojo б Yakuza komandа",Vardaz); // Formatuoja
SendClientMessageToAll(MELYNA,mess); // Nusiunиia юaidлjams
SetPlayerTeam(playerid,Yakuza); // Komanda
}
if(ZaidejoKomanda[playerid] == Triads) // Patikrinam, ar юaidлjas yra Yakuza komandoje.
{ // Atidarom funkcijа
SetPlayerColor(playerid,tSpalva); // Geltona
SetPlayerHealth(playerid, 100); // Gyvybлs
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 0); // Nustatom Colt-45 skill lygб б 0
SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, 0); // Nustatom MP5 skill lygб б 0
SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 0); // Nustatom M4-47 skill lygб б 0
SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, 0); // Nustatom Combat Shotgun skill lygб б 0
format(mess,sizeof(mess),"GangWars: %s бstojo б Triads komandа",Vardaz); // Formatuoja
SendClientMessageToAll(MELYNA,mess); // Nusiunиia юaidлjams
SetPlayerTeam(playerid,Triads); // Komanda
}
if(ZaidejoKomanda[playerid] == Nostra) // Patikrinam, ar юaidлjas yra La Cosa Nostra komandoje
{
SetPlayerColor(playerid,lSpalva); // Raudona
SetPlayerHealth(playerid, 100); // Gyvybлs
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, 0); // Nustatom Silenced Pistol skill lygб б 0
SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, 1); // Nustatom MP5 skill lygб б 0
SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 1); // Nustatom M4 skill lygб б 0
SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, 0); // Nustatom Combat Shotgun skill lygб б 0
format(mess,sizeof(mess),"GangWars: %s бstojo б La Cosa Nostra komandа",Vardaz); // Formatuoja
SendClientMessageToAll(MELYNA,mess); // Nusiunиia юaidлjams
SetPlayerTeam(playerid,Nostra); // Komanda
}
if(ZaidejoInformacija[playerid][Administratorius] > 0) // Jei AdminLvl didesnis negu 0, duodam jam daiktш
{ // Atidarom
SetPlayerHealth(playerid, 120); // Gyvybлs
SetPlayerColor(playerid, vSpalva);
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "Sveikas sugrбюжs Administratoriau.\nSavo komandas rasi paraржs /vkomandos.\nSekmлs darant tvarkа.", "Gerai", "Uюdaryti"); // Praneрam
}
if(ZaidejoKomanda[playerid] == Policija) // Patikrinam, ar юaidлjas yra Policijos komandoje
{ // Atidarom funkcijа
SetPlayerColor(playerid,mSpalva); // Mлlyna
SetPlayerHealth(playerid, 100); // Gyvybлs
SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 0); // Nustatom Deagle skill lygб б 0
SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, 1); // Nustatom MP5 skill lygб б 0
SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 1); // Nustatom M4 skill lygб б 0
SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, 1); // Nustatom Combat Shotgun skill lygб б 0
format(mess,sizeof(mess),"GangWars: %s бstojo б Policijos komandа",Vardaz); // Formatuoja
SendClientMessageToAll(MELYNA,mess); // Nusiunиia юaidлjams
SetPlayerTeam(playerid,Policija); // Komanda
} // Uюdarymas
return 1; // Uюdarymas
} // Uюdarymas

8hars... ;/
Reply
#6

Add this under all the SetPlayerColor in your function.

pawn Код:
for(new i=0; i<MAX_PLAYERS; i++) SetPlayerMarkerForPlayer( i, playerid, ( GetPlayerColor( playerid ) & 0xFFFFFF00 ) );

Tell me if this works.
Reply
#7

ok, im will test it soon. and one more question: im created that func, when player get ban from anticheat, server sends message to all players like this:

*Name* was banned. Reason: *Reason*. Banned players: *Number*. Its work good, but how can i save that number? Im using global variable new Uzblokuota;
Reply
#8

You have to save it in a file then. Just like you save the stats in a userfile.
Create a userfile for the Bans, and check it like the stats.
Reply
#9

Ok.. tryied:
ongamemodeinit
Quote:

new Failas[90]; // Stringas
Failas = "Uzblokuota.ini!"; // Failas
if(!fexist(Failas)) // Jei nлra sukыrta
{ // Atidarom
dini_Create(Failas); // Sukuriam failа
} // Uюdarom
Uzblokuota = dini_Int(Failas,"Uzblokuotu"); // 'Pakraunam' skaiиiш

and when player get ban

Quote:

dini_IntSet(Failas,"Uzblokuotu",Uzblokuota+1);

and i get
Quote:

C:\Documents and Settings\Admin\Desktop\Backupai\Backupai\GangWars\ gamemodes\GangWars.pwn(1991) : error 017: undefined symbol "Failas"
C:\Documents and Settings\Admin\Desktop\Backupai\Backupai\GangWars\ gamemodes\GangWars.pwn(2064) : error 017: undefined symbol "Failas"
C:\Documents and Settings\Admin\Desktop\Backupai\Backupai\GangWars\ gamemodes\GangWars.pwn(451 : error 017: undefined symbol "Failas"
C:\Documents and Settings\Admin\Desktop\Backupai\Backupai\GangWars\ gamemodes\GangWars.pwn(4992) : error 017: undefined symbol "Failas"
C:\Documents and Settings\Admin\Desktop\Backupai\Backupai\GangWars\ gamemodes\GangWars.pwn(5000) : error 017: undefined symbol "Failas"
C:\Documents and Settings\Admin\Desktop\Backupai\Backupai\GangWars\ gamemodes\GangWars.pwn(5015) : error 017: undefined symbol "Failas"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


6 Errors.

Reply
#10

Remove it at OnGameModeInit and set it To the TOP of your script. (Under the <include> ones.)
pawn Код:
new Failas[90]; // Stringas
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)