Hier einmal den Public von mir
PWN QUELLTEXT GEHT NICHT ..
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
new string[126];
new Damage1 = strval(string);
if(PlayerInfo[playerid][pImDMSchutz] == 1){
if(weaponid == 0){
ApplyAnimation(issuerid, "PED", "BIKE_fall_off", 4.1, 0, 1, 1, 1, 0, 1);
//TogglePlayerControllable(issuerid,0);
SetTimerEx("PressJump", 1000, false, "i", issuerid);
new Float:hp;
GetPlayerHealth(playerid,hp);
SetPlayerHealth(playerid,hp+Damage1);
}
}
if(PlayerInfo[issuerid][pImDMSchutz] == 1){
if(weaponid == 0){
ApplyAnimation(issuerid, "PED", "BIKE_fall_off", 4.1, 0, 1, 1, 1, 0, 1);
//TogglePlayerControllable(issuerid,0);
SetTimerEx("PressJump", 1000, false, "i", issuerid);
new Float:hp;
GetPlayerHealth(playerid,hp);
SetPlayerHealth(playerid,hp+Damage1);
}
}
if(HitSound[issuerid] == 1)
{
PlayerPlaySound(issuerid,17802,0.0,0.0,0.0);
}
format(string, sizeof(string), "%f", amount);
new Damage = strval(string);
new sendername[MAX_PLAYER_NAME],giveplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, giveplayer, sizeof(giveplayer)); //Er Verliert HP
GetPlayerName(issuerid, sendername, sizeof(sendername)); // Er hat Geschossen
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
for(new i = 0; i < MAX_PLAYERS; i++){
if(Schussmeldung == 1){
if (playerid != INVALID_PLAYER_ID ) {
if(IsPlayerInRangeOfPoint(playerid,50.0,x,y,z)){
format(string,sizeof(string),"[AdmWarning] In deiner Sichtweite hat [%d]%s dem Spieler [%d]%s %d HP abgezogen (Waffe: %s)",issuerid,SpielerName(issuerid),playerid,SpielerName(playerid),Damage,WaffenNamen[weaponid]);
SendClientMessage(i,COLOR_YELLOW,string);
}
}
}
}
if (playerid != INVALID_PLAYER_ID ) {
format(string,sizeof(string),"[dm] [%s] hat %s mit einer (%s) %d HP abgezogen.",SpielerName(issuerid),SpielerName(playerid),WaffenNamen[weaponid],Damage);
EnterToLog("dmlog",string);
}
if(NoDmTimer[playerid] > 0){
new PunishTime, PunsihRestTime;
if(IsAHitman(issuerid) && GoChase[issuerid] == playerid){
PunishTime = 60;
}
else{
PunishTime = 15;
}
PunsihRestTime = PunishTime-NoDmTimer[playerid];
if(PunsihRestTime > 0){
format(string, sizeof(string), "[NoDM] Der NoDM schutz deines Opfers beginnt in %d Sekunden.", PunsihRestTime);
SendClientMessage(issuerid,COLOR_GRAD2, string);
}
else
{
format(string, sizeof(string), "[NoDM] %s hat %s in der NoDM Zone angegriffen. Schaden: %d HP.", sendername,giveplayer,Damage);
SendClientMessage(playerid,COLOR_GRAD2, string);
}
}
if(SpawnKillAktiv[playerid] == 1 && weaponid != 54 && weaponid != 51){
SendClientMessage(issuerid,COLOR_YELLOW, "[Antispawnschutz]: Unterlass das Dm auf Usern mit Anti-Spawnschutz!");
format(string, sizeof(string), "[Antispawnschutz]: %s hat dich im Anti-Spawnschutz angeschossen!", sendername);
SendClientMessage(playerid,COLOR_YELLOW, string);
}
if(SpawnKillAktiv[issuerid] == 1){SpawnSkillSchutz(issuerid);}
if(weaponid == 23 && TazerCan[issuerid] == 1)
{
if(PlayerInfo[issuerid][pTeam] == 7 && OnDuty[issuerid] == 1 || PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[issuerid][pTeam] == 14 && OnDuty[issuerid] == 1 || PlayerInfo[issuerid][pTeam] == 16 && OnDuty[issuerid] == 1 || PlayerInfo[issuerid][pTeam] == 13 && OnDuty[issuerid] == 1)
{
if(PlayerInfo[issuerid][pLocal] == 100 || PlayerInfo[issuerid][pLocal] == 101 || PlayerInfo[issuerid][pLocal] == 102){
return 1;
}
if(IsPlayerInAnyVehicle(issuerid))
{
return 1;
}
new suspect = playerid;
if(IsPlayerConnected(suspect))
{
if(/*PlayerInfo[suspect][pSQLID] == 1 || PlayerInfo[suspect][pSQLID]] == 2 ||*/ PlayerInfo[suspect][pSQLID] == 3){
return 1;
}
if(PlayerCuffed[suspect] > 0)
{
SendClientMessage(issuerid, COLOR_ERRORTEXT, "Spieler ist schon getazert!");
return 1;
}
if(IsPlayerInAnyVehicle(suspect))
{
SendClientMessage(issuerid, COLOR_ERRORTEXT, "Ziel ist in einem Auto, die Person muss zuerst aussteigen!");
return 1;
}
GivePlayerWeapons(issuerid, PlayerInfo[issuerid][pGun2], PlayerInfo[issuerid][pAmmo2]);
TazerCan[issuerid] = 0;
format(string, sizeof(string), "* Du wurdest von %s elektrisiesrt für 30 sekunden.", sendername);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Du elektrisierst %s für 30 sekunden.", giveplayer);
SendClientMessage(issuerid, COLOR_LIGHTBLUE, string);
if(Maske[suspect] == 1)
{
format(string, sizeof(string), "* %s schießt mit dem Tazer auf einen Unbekannten, und elektrisiert ihn.", sendername);
ProxDetector(60.0, issuerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
format(string, sizeof(string), "* %s schießt mit dem Tazer auf %s, und elektrisiert ihn.", sendername ,giveplayer);
ProxDetector(60.0, issuerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
GameTextForPlayer(suspect, "~r~Tazed", 5000, 3);
ApplyAnimation(suspect, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); // Dieing of Crack
PlayerCuffed[suspect] = 1;
PlayerCuffedTime[suspect] = 30;
}
}
}
return 1;
}
ERRORCODE im samp-server.exe wenn ich Sterbe
[18:56:04] [debug] Run time error 4: "Array index out of bounds"
[18:56:04] [debug] Accessing element at index 65535 past array upper bound 282
[18:56:04] [debug] AMX backtrace:
[18:56:04] [debug] #0 000387c0 in public OnPlayerTakeDamage () from Original.amx
[18:56:06] [debug] Run time error 4: "Array index out of bounds"
[18:56:06] [debug] Accessing element at index 65535 past array upper bound 282
[18:56:06] [debug] AMX backtrace:
[18:56:06] [debug] #0 000387c0 in public OnPlayerTakeDamage () from Original.amx