Moin,
ich hab da ein paar Probleme mit meinem Team.
1. Antiteamkill System:
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid,playerid,reason););
new name1[16], string1[60];
if(gTeam[killerid] != gTeam[playerid])
{
GetPlayerName(playerid, name1, sizeof(name1));
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
}
else
{
SendClientMessage(playerid, COLOR_RED, "Don't kill your friends!");
teamkills[killerid] = teamkills[killerid] + 1;
//SetPlayerScore(killerid,GetPlayerScore(killerid)-2);
}
if (teamkills[killerid] > 3)
{
Kick(killerid);
format(string1, sizeof(string1), "%s has been kicked! Reason: Teamkilling!", name1);
SendClientMessageToAll(COLOR_RED, string1);
}
return 1;
}
Funktioniert nicht...
2. Teameffekt funktioniert nur teilweise:
dcmd_scan(id,o[]) {
#pragma unused o
new playerTeam = gTeam[id];
//for(new i; i<GetMaxPlayers(); i++)
for (new i=0; i<GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if (gTeam[i] == playerTeam)
{
SetPlayerMapIcon(playerTeam, 0, 395.5647,2531.4995,16.5437, 19, 0 );
SetPlayerMapIcon(playerTeam, 1, -1299.3761,2494.4709,87.0189, 19, 0 );
SetPlayerMapIcon(playerTeam, 2, 2204.9468, 1986.2877, 16.7380, 19, 0 );
SetPlayerMapIcon(playerTeam, 3, -2243.9280,2350.4146,5.2666, 19, 0 );
SetPlayerMapIcon(playerTeam, 4, 308.2178,2026.6685,17.6406, 19, 0 );
SetPlayerMapIcon(playerTeam, 5, -110.4671,1138.0920,19.7422, 19, 0 );
SendTeamMessage(playerTeam, COLOR_GREEN, "Scan has been started! All bases has been marked on the map!");
//SetProTimer("Scantimer",30,0);
}
}
}
return 1;
}
Man bekommt nur 1 Icon auf der Karte zu sehen und die Message "Scan has.." kommt 2mal hintereinander.
3. Timer für die Funktion 2 sinnvoll setzen? Wie mache ich das denn am besten? Schließlich sollten alle 5 Teams den Command gleichzeitig benutzen können.