ja okay dann mach ichs selber nach dem ich ausgepennt habe
Zitat
D:\GTA SA MP\filterscripts\death.pwn(2) : error 017: undefined symbol "0"
D:\GTA SA MP\filterscripts\death.pwn(125) : warning 217: loose indentation
und die zeilen dazu
zeile 2
#pragma unused 0
zeile 125
return 0;
und das ganze
#include <a_samp>
#pragma unused 0
#define FILTERSCRIPT
new Dead[MAX_PLAYERS], Float:DX[MAX_PLAYERS], Float:DY[MAX_PLAYERS],Float:DZ[MAX_PLAYERS],Float:DA[MAX_PLAYERS],DTimer[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
Dead[playerid] = 0;
return 1;
}
public OnPlayerDeath(playerid,killerid,reason)
{
Dead[playerid] = 1;
GetPlayerPos(playerid,DX[playerid],DY[playerid],DZ[playerid]);
GetPlayerFacingAngle(playerid,DA[playerid]);
DTimer[playerid] = SetTimerEx("DSpawn", 180*1000, 0, "i",playerid);
return 1;
}
public OnPlayerDisconnect(playerid,reason)
{
Dead[playerid] = 0;
return 1;
}
public OnPlayerSpawn(playerid)
{
if(Dead[playerid] == 1)
{
SetTimerEx("DSpawned", 100, 0, "i",playerid);
}
return 1;
}
forward DSpawn(playerid);
public DSpawn(playerid)
{
if(Dead[playerid] == 1)
{
Dead[playerid] = 0;
TogglePlayerControllable(playerid,1);
ClearAnimations(playerid);
SpawnPlayer(playerid);
SetPlayerHealth(playerid,100);
SetCameraBehindPlayer(playerid);
}
}
forward DSpawned(playerid);
public DSpawned(playerid)
{
if(Dead[playerid] == 1)
{
SetPlayerPos(playerid,DX[playerid],DY[playerid],DZ[playerid]);
SetPlayerHealth(playerid,1); // Soll so aussehen, als ob man 0 Leben hätte^^
SetPlayerCameraPos(playerid,DX[playerid],DY[playerid],DZ[playerid]+3);
ResetPlayerWeapons(playerid);
SetPlayerCameraLookAt(playerid,DX[playerid],DY[playerid],DZ[playerid]);
SetPlayerFacingAngle(playerid,DA[playerid]);
TogglePlayerControllable(playerid,0);
ApplyAnimation(playerid,"PARACHUTE","FALL_skyDive_DIE",4.1,0,1,1,1,1);
}
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/kill", cmdtext, true, 10) == 0) //Zum Testen
{
SetPlayerHealth(playerid,0);
return 1;
}
new cmd[30];
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/heilen", true) == 0)
{
new tmp[30];
tmp = strtok(cmdtext, idx);
new otherplayer = strval(tmp);
new Float:X,Float:Y,Float:Z;
GetPlayerPos(otherplayer,X,Y,Z);
if(IsPlayerConnected(otherplayer) == 1 && Dead[otherplayer] == 1 && IsPlayerInRangeOfPoint(playerid, 2.0, X, Y, Z) && playerid != otherplayer && Dead[playerid] == 0)
{
Dead[otherplayer] = 0;
TogglePlayerControllable(otherplayer,1);
KillTimer(DTimer[otherplayer]);
SetPlayerHealth(otherplayer,50);
SetCameraBehindPlayer(otherplayer);
ApplyAnimation(playerid,"ped","getup",2.5,0,1,1,0,1);
new Heilername[MAX_PLAYER_NAME];
new Opfername[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(otherplayer, Opfername, sizeof(Opfername));
format(string, sizeof(string), "Du hast %s (ID:%d) wiederbelebt.",Opfername,otherplayer);
SendClientMessage(playerid,0xFFFF00AA, string);
new stringz[128];
GetPlayerName(playerid, Heilername, sizeof(Heilername));
format(stringz, sizeof(stringz), "Du wurdest von %s (ID:%d) wiederbelebt.",Heilername,playerid);
SendClientMessage(otherplayer,0xFFFF00AA, stringz);
}
return 1;
}
return 0;
}
public OnPlayerText(playerid, text[])
{
if(Dead[playerid] == 1)
{
SendClientMessage(playerid,0xFFFF00AA,"Tote können nicht reden.");
return 0;
}
return 1;
}