Get killer team colo - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Get killer team colo (
/showthread.php?tid=237401)
Get killer team colo -
aqu - 09.03.2011
Hello,I need to code that system get killer team color.
I scripted like this
Код:
// Team info
enum teaminfo
{
TeamColor,
}
// Script to get killerid team color
new killerteamcolor;
killerteamcolor = killerid [TeamColor];
Errors:
Код:
C:\Users\bendra\Desktop\GangWarsServer\gamemodes\xLSTW.pwn(2201) : error 028: invalid subscript (not an array or too many subscripts): "killerid"
C:\Users\bendra\Desktop\GangWarsServer\gamemodes\xLSTW.pwn(2201) : warning 215: expression has no effect
C:\Users\bendra\Desktop\GangWarsServer\gamemodes\xLSTW.pwn(2201) : error 001: expected token: ";", but found "]"
C:\Users\bendra\Desktop\GangWarsServer\gamemodes\xLSTW.pwn(2201) : error 029: invalid expression, assumed zero
C:\Users\bendra\Desktop\GangWarsServer\gamemodes\xLSTW.pwn(2201) : fatal error 107: too many error messages on one line
Please help
Re: Get killer team colo -
Mean - 09.03.2011
Well
pawn Код:
public OnPlayerDeath( playerid, killerid, reason )
{
new color = GetPlayerColor( killerid );
SendClientMessage( playerid, color, "This is killer's color" );
return 1;
}
Is that what are you trying to do?
Re: Get killer team colo -
aqu - 09.03.2011
hmmm.. propobly.I want to make that turf would flash with attacker color.It look like:
Код:
if (gTeam[ b ] == turfs[ i ][ TurfAttacker ]) {
new color = GetPlayerColor( killerid );
new msg1[ 256 ];
format(msg1,sizeof(msg1), "~w~We have provoked a turfwar ~w~in ~y~%s ~w~against the ~r~%s",
turfs[ i ][ turfName ], TeamInfo[ turfs[ i ][ TurfOwner ] ][ TeamName ]);
new Text:txt1 = TextDrawCreate( 200.0, 385.0, msg1 );
TextDrawFont( txt1, 0 );
TextDrawSetShadow( txt1, 0 );
TextDrawSetOutline( txt1, 1 );
TextDrawColor( txt1, 0xDFDFDFFF );
TimeTextForPlayer( b, txt1, 6000 );
GangZoneFlashForPlayer( b, turfs[ i ][turfID], color );
}
else if (gTeam[b] == turfs[ i ][ TurfOwner ]) {
new msg2[ 256 ];
format(msg2,sizeof(msg2), "~r~The ~y~%s ~r~have attacked our turf!",
TeamInfo[ turfs[ i ][ TurfAttacker ] ][ TeamName ], turfs[ i ][ turfName ]);
new Text:txt2 = TextDrawCreate( 200.0, 370.0, msg2 );
TextDrawFont( txt2, 0 );
TextDrawSetShadow( txt2, 0 );
TextDrawSetOutline( txt2, 1 );
TextDrawColor( txt2, COLOR_RED );
TimeTextForPlayer( b, txt2, 6000 );
GangZoneFlashForPlayer( b, turfs[ i ][turfID], TeamColor );
}
else { GangZoneFlashForPlayer( b, turfs[ i ][turfID], TeamColor ); }