Problems with filterscript
#1

I have a problem with this filterscript.

picture of the problem:



my code on GAME MODE:

PHP код:
public OnPlayerDeath(playeridkilleridreason
the codes of filterscript:

PHP код:
    // Please keep credits.. PLEASE..
     
                                                            /*                                   *\
                                                            |                                     |
                                                            *               admantis              *
                                                            \                                    /
     
                                                           
    */
    #include                                                        <a_samp>
    #include                                                        <a_players>
     
    #define CYAN                                            0x00D2E1FF
    #define WHITE                                           0xFFFFFFAA
    #define PURPLE                      0xC2A2DAAA
    #define AFTERLIFE_SECONDS           120 // 2 Minutes
    #define AUTODEATH_SECONDS           300 // 5 Minutes
    #define SCM                                             SendClientMessage
    #define dcmd(%1,%2,%3)                          if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
     
    
new Float:DeathPosX                                     [MAX_PLAYERS];
    new 
Float:DeathPosY                                     [MAX_PLAYERS];
    new 
Float:DeathPosZ                                     [MAX_PLAYERS];
    new 
IsDead                                                      [MAX_PLAYERS];
    new 
SecsToGo                                            [MAX_PLAYERS];
    new 
IsAfterLifing                                       [MAX_PLAYERS];
    new 
AfterLifeTimer;
     
    
forward AfterLife(playerid);
    
forward AutoDeath(playerid);
    
forward ProxDetector(Float:radiplayeridstring[],col1,col2,col3,col4,col5);
     
    public 
OnPlayerSpawn(playerid)
    {
            
IsAfterLifing[playerid] = 0;
            if (
IsDead[playerid] == 1)
            {
                
SetPlayerPos(playerid,DeathPosX[playerid],DeathPosY[playerid],DeathPosZ[playerid]);
                
SetPlayerCameraPos(playerid,DeathPosX[playerid],DeathPosY[playerid],DeathPosZ[playerid]+5);
                
SetPlayerCameraLookAt(playerid,DeathPosX[playerid],DeathPosY[playerid],DeathPosZ[playerid]);
                
TogglePlayerControllable(playerid,false);
                    
ApplyAnimation(playerid,"PARACHUTE","FALL_skyDive_DIE"4.000010);
                
SetTimerEx("AutoDeath",AUTODEATH_SECONDS 1000,false,"i",playerid);
                
SCM(playerid,CYAN,"------------------ Health Advise -----------------");
                
SCM(playerid,WHITE,"You are now laying death. You are bleeding to death.");
                
SCM(playerid,WHITE,"Remember that the medics can revive you.");
                
SCM(playerid,WHITE,"You can type /acceptdeath, if no medics are available.");
                
SCM(playerid,CYAN,"--------------------------------------------------------");
                return 
1;
            }
            return 
1;
    }
               
    public 
OnPlayerDeath(playeridkilleridreason)
    {
        new 
Float:pXFloat:pYFloat:pZ;
        
GetPlayerPos(playeridpXpYpZ);
        
DeathPosX[playerid] = pX;
        
DeathPosY[playerid] = pY;
        
DeathPosZ[playerid] = pZ;
        
IsDead[playerid] = 1;
        return 
1;
    }
     
    public 
OnPlayerCommandText(playeridcmdtext[])
    {
            
dcmd(acceptdeath11cmdtext);
            return 
0;
    }
     
    
dcmd_acceptdeath(playeridparams[])
    {
            
#pragma unused params
            
if (IsDead[playerid] == 0) { return 0; }
            else
            {
                
IsDead[playerid] = 0;
                
SecsToGo[playerid] = AFTERLIFE_SECONDS;
                
CleanPlayerChat(playerid);
                
SCM(playerid,CYAN,"------------------ Health Advise -----------------");
                
SCM(playerid,WHITE,"You are now in the afterlife. You may rest in peace.");
                
SCM(playerid,WHITE,"When you revive, you will lost memory of last 30 minutes.");
                
SCM(playerid,WHITE,"If you were non-RPly killed, report the player at the forums.");
                
SCM(playerid,CYAN,"--------------------------------------------------------");
                
SetPlayerPos(playerid,000);
                
SetPlayerCameraPos(playerid,DeathPosX[playerid],DeathPosY[playerid],DeathPosZ[playerid]);
                
SetPlayerCameraLookAt(playerid,DeathPosX[playerid],DeathPosY[playerid],DeathPosZ[playerid]+100);
                
AfterLifeTimer SetTimerEx("AfterLife",1000,true,"i",playerid);
                return 
1;
             }
    }
     
    public 
OnPlayerText(playeridtext[])
    {
            if (
IsAfterLifing[playerid] == 1) { return 0; }
            return 
1;
    }
     
    public 
AfterLife(playerid)
    {
            
IsAfterLifing[playerid] = 1;
            
SecsToGo[playerid]--;
        new 
string[128];
            
format(string,sizeof(string),"~b~ ~h~ ~h~you are in afterlife~n~ ~b~ ~h~ ~h~you will revive in %d seconds",SecsToGo[playerid]);
            
GameTextForPlayer(playerid,string,1100,3);
            if (
SecsToGo[playerid] <= 0)
        {
            
CleanPlayerChat(playerid);
            
KillTimer(AfterLifeTimer);
            
SCM(playerid,CYAN,"------------------ Health Advise -----------------");
                
SCM(playerid,WHITE,"You have revived after a long rest.");
                
SCM(playerid,WHITE,"The medics have threated you and now you are healthy.");
                
SCM(playerid,WHITE,"Remember, you have lost memory of recent 30 minutes.");
                
SCM(playerid,CYAN,"--------------------------------------------------------");
                
SpawnPlayer(playerid);
                return 
1;
            }
            return 
1;
    }
     
    public 
AutoDeath(playerid)
    {
            if (
IsDead[playerid] == 0) { return 0; }
            else if (
IsDead[playerid] == 1)
            {
                new 
saystring[128], deathstring[128], name[28];
                
GetPlayerName(playerid,name,sizeof(name));
                    switch (
random(2))
                    {
                    case 
0:
                            {
                                    
format(saystring,sizeof(saystring),"%s mumbles: I can't hold more.."name);
                                    
format(deathstring,sizeof(deathstring),"* %s closes his eyes, falling into death."name);
                            }
                            case 
1:
                            {
                                
format(saystring,sizeof(saystring),"%s mumbles: Aghh.. It's cold.. I feel something.. A light-..",name);
                                
format(deathstring,sizeof(deathstring),"* %s is now inmobilized, and dead.",name);
                            }
                    }
                    
ProxDetector(30playeriddeathstringPURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
                    
ProxDetector(10playeridsaystringWHITE,WHITE,WHITE,WHITE,WHITE);
     
                    
IsDead[playerid] = 0;
                
SecsToGo[playerid] = AFTERLIFE_SECONDS;
                
SCM(playerid,CYAN,"------------------ Health Advise -----------------");
                
SCM(playerid,WHITE,"You are now in the afterlife. You may rest in peace.");
                
SCM(playerid,WHITE,"When you revive, you will lost memory of last 30 minutes.");
                
SCM(playerid,WHITE,"If you were non-RPly killed, report the player at the forums.");
                
SCM(playerid,CYAN,"--------------------------------------------------------");
                
SetPlayerPos(playerid,000);
                
SetPlayerCameraPos(playerid,DeathPosX[playerid],DeathPosY[playerid],DeathPosZ[playerid]);
                
SetPlayerCameraLookAt(playerid,DeathPosX[playerid],DeathPosY[playerid],DeathPosZ[playerid]+100);
                
AfterLifeTimer SetTimerEx("AfterLife",1000,true,"i",playerid);
                return 
1;
            }
            return 
1;
    }
                                   
           
           
           
    public 
ProxDetector(Float:radiplayeridstring[],col1,col2,col3,col4,col5)
    {
        if(
IsPlayerConnected(playerid))
        {
            new 
Float:posxFloat:posyFloat:posz;
            new 
Float:oldposxFloat:oldposyFloat:oldposz;
            new 
Float:tempposxFloat:tempposyFloat:tempposz;
            
GetPlayerPos(playeridoldposxoldposyoldposz);
            for(new 
0MAX_PLAYERSi++)
            {
                if(
IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
                {
                    
GetPlayerPos(iposxposyposz);
                    
tempposx = (oldposx -posx);
                    
tempposy = (oldposy -posy);
                    
tempposz = (oldposz -posz);
                    if (((
tempposx radi/16) && (tempposx > -radi/16)) && ((tempposy radi/16) && (tempposy > -radi/16)) && ((tempposz radi/16) && (tempposz > -radi/16)))
                    {
                        
SendClientMessage(icol1string);
                    }
                    else if (((
tempposx radi/8) && (tempposx > -radi/8)) && ((tempposy radi/8) && (tempposy > -radi/8)) && ((tempposz radi/8) && (tempposz > -radi/8)))
                    {
                        
SendClientMessage(icol2string);
                    }
                    else if (((
tempposx radi/4) && (tempposx > -radi/4)) && ((tempposy radi/4) && (tempposy > -radi/4)) && ((tempposz radi/4) && (tempposz > -radi/4)))
                    {
                        
SendClientMessage(icol3string);
                    }
                    else if (((
tempposx radi/2) && (tempposx > -radi/2)) && ((tempposy radi/2) && (tempposy > -radi/2)) && ((tempposz radi/2) && (tempposz > -radi/2)))
                    {
                        
SendClientMessage(icol4string);
                    }
                    else if (((
tempposx radi) && (tempposx > -radi)) && ((tempposy radi) && (tempposy > -radi)) && ((tempposz radi) && (tempposz > -radi)))
                    {
                        
SendClientMessage(icol5string);
                    }
                }
            }
        }
        return 
1;
    }
     
    
stock CleanPlayerChat(playerid)
    {
            
SCM(playerid,WHITE," ");
            
SCM(playerid,WHITE," ");
            
SCM(playerid,WHITE," ");
            
SCM(playerid,WHITE," ");
            
SCM(playerid,WHITE," ");
            
SCM(playerid,WHITE," ");
            
SCM(playerid,WHITE," ");
            
SCM(playerid,WHITE," ");
            
SCM(playerid,WHITE," ");
            
SCM(playerid,WHITE," ");
            
SCM(playerid,WHITE," ");
            
SCM(playerid,WHITE," ");
            
SCM(playerid,WHITE," ");
            
SCM(playerid,WHITE," ");
            
SCM(playerid,WHITE," ");
            
SCM(playerid,WHITE," ");
            
SCM(playerid,WHITE," ");
    } 
When shooting me I die automatically, but I updated this system on my filterscript before dying to do the command / accept death but somehow I still died. Thanks for helpers
Reply
#2

Make sure you reset your variables when approriate. For example, after they've died you needa set IsDead to 0...
Reply
#3

Add the name of the filter script to the filter scripts like in the server.cfg. Or you could add that all to the main gamemode.
Reply
#4

I put the this filterscript in my filterscript folder and in the server.cfg, the system work but if someone kill me its dont send me the /accept death or service medic... you understund? and thanks for the help people.
Reply
#5

and if i need to change codes please people change for me and send me the codes with reply.

Thanks
Reply
#6

I put the system in my gamemode and i got problems

Quote:

C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(20301) : warning 213: tag mismatch
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(20301) : warning 204: symbol is assigned a value that is never used: "Float"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(20485) : warning 219: local variable "health" shadows a variable at a preceding level
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(22300) : warning 213: tag mismatch
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(22689) : warning 217: loose indentation
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(22694) : warning 217: loose indentation
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(27033) : warning 217: loose indentation
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(27461) : warning 217: loose indentation
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(27466) : warning 217: loose indentation
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(28130) : warning 217: loose indentation
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(28196) : warning 217: loose indentation
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(28220) : warning 217: loose indentation
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(28372) : warning 217: loose indentation
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(28377) : warning 217: loose indentation
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(35034) : warning 213: tag mismatch
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(35034) : warning 213: tag mismatch
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(35034) : warning 213: tag mismatch
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(35034) : warning 213: tag mismatch
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(35034) : warning 213: tag mismatch
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(46787) : warning 217: loose indentation
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58206) : error 021: symbol already defined: "OnPlayerSpawn"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58214) : warning 217: loose indentation
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58215) : warning 217: loose indentation
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58215) : error 017: undefined symbol "AUTODEATH_SECONDS"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58216) : error 017: undefined symbol "SCM"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58217) : error 017: undefined symbol "SCM"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(5821 : error 017: undefined symbol "SCM"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58219) : error 017: undefined symbol "SCM"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58220) : error 017: undefined symbol "SCM"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58227) : error 021: symbol already defined: "OnPlayerDeath"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(5823 : error 021: symbol already defined: "OnPlayerCommandText"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58250) : error 017: undefined symbol "AFTERLIFE_SECONDS"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58252) : error 017: undefined symbol "SCM"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58253) : error 017: undefined symbol "SCM"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58254) : error 017: undefined symbol "SCM"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58255) : error 017: undefined symbol "SCM"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58256) : error 017: undefined symbol "SCM"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58266) : error 021: symbol already defined: "OnPlayerText"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58275) : warning 217: loose indentation
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58276) : warning 217: loose indentation
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58282) : error 017: undefined symbol "SCM"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58283) : warning 217: loose indentation
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58283) : error 017: undefined symbol "SCM"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58284) : error 017: undefined symbol "SCM"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58285) : error 017: undefined symbol "SCM"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58286) : error 017: undefined symbol "SCM"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58300) : warning 217: loose indentation
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58317) : warning 217: loose indentation
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58317) : error 017: undefined symbol "AFTERLIFE_SECONDS"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(5831 : error 017: undefined symbol "SCM"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58319) : error 017: undefined symbol "SCM"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58320) : error 017: undefined symbol "SCM"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\gamemodes\IRP.pwn(58321) : error 017: undefined symbol "SCM"

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


26 Errors.

Reply
#7

Код:
"And are we meant to guess your code?"
 - Y Less
Reply
#8

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
//   printf("OnPlayerDeath: playerid: %d, killerid: %d, reason: %s", playerid, killerid, reason); //debug
    
if (PlayerInfo[playerid][pHungry] == || PlayerInfo[playerid][pThirsty] == 1)
    {
        
PlayerInfo[playerid][pHungry] = 360;
        
PlayerInfo[playerid][pThirsty] = 300;
    }
    
ClearGuns(playerid);
    
SetPlayerColor(playeridTCOLOR_HOSPITAL);
    
GameTextForPlayer(playerid,"~w~Wasted",4000,2);
    
SetPlayerVirtualWorld(playerid0);
    
PlayerInfo[playerid][pOnDuty] = 0;
    
PlayerInfo[playerid][pBombs] = 0;
    
PlayerInfo[playerid][pScope] = 0;
    
PlayerInfo[playerid][pLocal] = 999;
    
PlayerInfo[playerid][pVirtualWorld] = 0;
    
PlayerInfo[killerid][pKills] += 1;
    
WithGlasses[playerid] = 0;
    
Parrot[playerid] = 0;
    
WithMask[playerid] = 0;
    
WithHat[playerid] = 0;
    
WithBandana[playerid] = 0;
    
WithHelmet[playerid] = 0;
    
wrench[playerid] = 0;
    
hammer[playerid] = 0;
    
crowbar[playerid] = 0;
    
chainsawdildo[playerid] = 0;
    
flashlight[playerid] = 0;
    
screwdriver[playerid] = 0;
    
rake[playerid] = 0;
    
AShield[playerid] = 0;
    
BShield[playerid] = 0;
    
PlayerInfo[playerid][pInHouse] = 999;
    
PlayerInfo[playerid][pInBiz] = 999;
    if(
PlayerInfo[playerid][Lockpicking] > 0)
    {
        
PlayerInfo[playerid][Lockpicking] = 0;
        
PlayerInfo[playerid][CLockpick] = 0;
        
PlayerInfo[playerid][HLockpick] = 999;
    }
    
STDPlayer[playerid] = 0;
    
IsAtEvent[playerid] = 0;
    new 
name[MAX_PLAYER_NAME];
    new 
killa[MAX_PLAYER_NAME];
    new 
string[128];
    new 
caller Mobile[playerid];
    
GetPlayerName(playeridnamesizeof(name));
    
GetPlayerName(killeridkillasizeof(killa));
    if(
LoadingCashType[playerid] != 0)
    { 
Reply
#9

Which lines of your code are these?
Reply
#10

17003-17053 i think need to change the "onplayerdead" lines...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)