errors
#5

Guys this is the script:-
PHP код:
forward DMRefundOnLogout(playerid);
forward OnDeathMatchRecord(shootervictim);
enum EDMRefund {
    
WhoKilledVictim[128],
    
HasDied,    
    
CharID,
    
Pot,
    
Coke,
    
Meth,
    
MatsA,
    
MatsB,
    
MatsC,
    
MatsD,
    
MatAPacks,
    
MatBPacks,
    
MatCPacks,
    
MatDPacks,
}
new 
DMRefund[MAX_PLAYERS][EDMRefund];
public 
DMRefundOnLogout(playerid) {
    for(new 
i=0;i<MAX_PLAYERS;i++) {
        if(
GetPVarInt(playerid"CharID") == DMRefund[i][CharID]) {
            
resetRefundEnums(i);
            return 
1;
        }
    }
    return 
1;
}
stock resetRefundEnums(Victim) {
    new 
name[128];
    
name "NULL";
    
DMRefund[Victim][WhoKilledVictim] = name;
    
DMRefund[Victim][HasDied] = -1;
    
DMRefund[Victim][CharID] = -1;
    
DMRefund[Victim][Pot] = -1;
    
DMRefund[Victim][Coke] = -1;
    
DMRefund[Victim][Meth] = -1;
    
DMRefund[Victim][MatsA] = -1;
    
DMRefund[Victim][MatsB] = -1;
    
DMRefund[Victim][MatsC] = -1;
    
DMRefund[Victim][MatsD] = -1;
    
DMRefund[Victim][MatAPacks] = -1;
    
DMRefund[Victim][MatBPacks] = -1;
    
DMRefund[Victim][MatCPacks] = -1;
    
DMRefund[Victim][MatDPacks] = -1;
}
stock VictimItemLossMessage(victim) {
    new 
potcokemethmatsamatsbmatscmatsdmatAPacksmatBPacksmatCPacksmatDPacksmsg[128], killer[128];
    
killer "SYSTEM DEATH";
    
pot DMRefund[victim][Pot];
    
coke DMRefund[victim][Coke];
    
meth DMRefund[victim][Meth];
    
matsa DMRefund[victim][MatsA];
    
matsb DMRefund[victim][MatsB];
    
matsc DMRefund[victim][MatsC];
    
matsd DMRefund[victim][MatsD];
    
matAPacks DMRefund[victim][MatAPacks];
    
matBPacks DMRefund[victim][MatBPacks];
    
matCPacks DMRefund[victim][MatCPacks];
    
matDPacks DMRefund[victim][MatDPacks];
    if(
pot <= 0)   { pot 0; }
    if(
coke <= 0)  { coke 0; }
    if(
meth <= 0)  { meth 0; }
    if(
matsa <= 0) { matsa 0; }
    if(
matsb <= 0) { matsb 0; }
    if(
matsc <= 0) { matsc 0; }
    if(
matsd <= 0) { matsd 0; }
    if(
matAPacks <= 0) { matAPacks 0; }
    if(
matBPacks <= 0) { matBPacks 0; }
    if(
matCPacks <= 0) { matCPacks 0; }
    if(
matDPacks <= 0) { matDPacks 0; }
    
SendClientMessage(victimX11_TOMATO_2"If you were DM'd and no admins are on. TAKE A SCREEN SHOT NOW!");
    
format(msgsizeof(msg), "You: %s were killed by %s"GetPlayerNameEx(victimENameType_RPName_NoMask), DMRefund[victim][WhoKilledVictim]);
    
SendClientMessage(victimX11_TOMATO_2msg);
    
format(msgsizeof(msg), "You: %s"GetPlayerNameEx(victimENameType_RPName_NoMask));
    
SendClientMessage(victimX11_TOMATO_2msg);
    
format(msgsizeof(msg), "You: %s - Lost Drugs - Pot: %d, Coke: %d, Meth: %d"GetPlayerNameEx(victimENameType_RPName_NoMask), potcokemeth);
    
SendClientMessage(victimX11_TOMATO_2msg);
    
format(msgsizeof(msg), "You: %s - Lost Materials  - MatsA: %d, MatsB: %d, MatsC: %d, MatsD: %d"GetPlayerNameEx(victimENameType_RPName_NoMask), matsamatsbmatscmatsd);
    
SendClientMessage(victimX11_TOMATO_2msg);
    
format(msgsizeof(msg), "You: %s - Lost Material Packs  - matsAPacks: %d, matsCPacks: %d, matsCPacks: %d, matsDPacks: %d"GetPlayerNameEx(victimENameType_RPName_NoMask), matAPacksmatBPacksmatCPacksmatDPacks);
    
SendClientMessage(victimX11_TOMATO_2msg);
    return 
1;
}
public 
OnDeathMatchRecord(shootervictim) {
    if(
isInPaintball(victim) || IsPlayerInEvent(victim) || isPlayerDying(victim) || (IsAnLEO(victim) && IsOnDuty(victim)) || isBoxing(victim)) {
        return 
1;
    }
    new 
name[128];
    
name GetPlayerNameEx(shooterENameType_RPName_NoMask);
    if(
strlen(name) <= 3) { name "System Death"; }
    
DMRefund[victim][WhoKilledVictim] = name;
    
DMRefund[victim][HasDied] = 1;
    
DMRefund[victim][CharID] = GetPVarInt(victim"CharID");
    
DMRefund[victim][Pot] = GetPVarInt(victim"Pot");
    
DMRefund[victim][Coke] = GetPVarInt(victim"Coke");
    
DMRefund[victim][Meth] = GetPVarInt(victim"Meth");
    
DMRefund[victim][MatsA] = GetPVarInt(victim"MatsA");
    
DMRefund[victim][MatsB] = GetPVarInt(victim"MatsB");
    
DMRefund[victim][MatsC] = GetPVarInt(victim"MatsC");
    
DMRefund[victim][MatsD] = GetPVarInt(victim"MatsD");
    
DMRefund[victim][MatAPacks] = GetPVarInt(victim"MatAPacks");
    
DMRefund[victim][MatBPacks] = GetPVarInt(victim"MatBPacks");
    
DMRefund[victim][MatCPacks] = GetPVarInt(victim"MatCPacks");
    
DMRefund[victim][MatDPacks] = GetPVarInt(victim"MatDPacks");
    
VictimItemLossMessage(victim);
    return 
1;
}
YCMD:checkdeath(playeridparams[], help) {
    if(
help) {
        
SendClientMessage(playeridX11_YELLOW_2"USAGE: /checkdeath playerid");
        return 
1;
    }
    new 
victim;
    new 
potcokemethmatsamatsbmatscmatsdmatAPacksmatBPacksmatCPacksmatDPacksmsg[128];
    if(!
sscanf(playerid,params"k<playerLookup_acc>"victim)) {
        if(!
IsPlayerConnectEx(victim)) {
            
SendClientMessage(playeridX11_TOMATO_2 ,"User not found.");
            return 
1;
        }
        if(
DMRefund[victim][HasDied] != 1) {
            
SendClientMessage(playeridX11_TOMATO_2"This user has not been killed recently");
            return 
1;
        } else {            
            
pot DMRefund[victim][Pot];
            
coke DMRefund[victim][Coke];
            
meth DMRefund[victim][Meth];
            
matsa DMRefund[victim][MatsA];
            
matsb DMRefund[victim][MatsB];
            
matsc DMRefund[victim][MatsC];
            
matsd DMRefund[victim][MatsD];
            
matAPacks DMRefund[victim][MatAPacks];
            
matBPacks DMRefund[victim][MatBPacks];
            
matCPacks DMRefund[victim][MatCPacks];
            
matDPacks DMRefund[victim][MatDPacks];
            if(
pot <= 0)   { pot 0; }
            if(
coke <= 0)  { coke 0; }
            if(
meth <= 0)  { meth 0; }
            if(
matsa <= 0) { matsa 0; }
            if(
matsb <= 0) { matsb 0; }
            if(
matsc <= 0) { matsc 0; }
            if(
matsd <= 0) { matsd 0; }
            if(
matAPacks <= 0) { matAPacks 0; }
            if(
matBPacks <= 0) { matBPacks 0; }
            if(
matCPacks <= 0) { matCPacks 0; }
            if(
matDPacks <= 0) { matDPacks 0; }
            
format(msgsizeof(msg), "User: %s was killed by %s"GetPlayerNameEx(victimENameType_RPName_NoMask), DMRefund[victim][WhoKilledVictim]);
            
SendClientMessage(playeridX11_TOMATO_2msg);            
            
SendClientMessage(playeridX11_TOMATO_2msg);            
            
format(msgsizeof(msg), "User: %s - Lost Drugs - Pot: %d, Coke: %d, Meth: %d"GetPlayerNameEx(victimENameType_RPName_NoMask), potcokemeth);
            
SendClientMessage(playeridX11_TOMATO_2msg);
            
format(msgsizeof(msg), "User: %s - Lost Materials - MatsA: %d, MatsB: %d, MatsC: %d, MatsD: %d"GetPlayerNameEx(victimENameType_RPName_NoMask), matsamatsbmatscmatsd);
            
SendClientMessage(playeridX11_TOMATO_2msg);
            
format(msgsizeof(msg), "User: %s - Lost Material Packs - matsAPacks: %d, matsCPacks: %d, matsCPacks: %d, matsDPacks: %d"GetPlayerNameEx(victimENameType_RPName_NoMask), matAPacksmatBPacksmatCPacksmatDPacks);
            
SendClientMessage(playeridX11_TOMATO_2msg);
        }
    } else {
        
SendClientMessage(playeridX11_YELLOW_2"USAGE: /checkdeath playerid");
        return 
1;
    }
    return 
1;
}
YCMD:undodeath(playeridparams[], help) {
    if(
help) {
        
SendClientMessage(playeridX11_YELLOW_2"USAGE: /undodeath playerid");
        return 
1;
    }
    new 
Victim;
    new 
potcokemethmatsamatsbmatscmatsdmatAPacksmatBPacksmatCPacksmatDPacksmsg[128];
    if(!
sscanf(playerid,params"k<playerLookup_acc>"Victim)) {
        if(!
IsPlayerConnectEx(Victim)) {
            
SendClientMessage(playeridX11_TOMATO_2 ,"User not found.");
            return 
1;
        }
        if(
playerid == Victim) { 
            
SendClientMessage(playeridX11_TOMATO_2"You cannot use this on yourself!");
            return 
1;
        }
        if(
DMRefund[Victim][HasDied] != || DMRefund[Victim][HasDied] == -1) {
            
SendClientMessage(playeridX11_TOMATO_2"This user has not been killed recently");
            return 
1;
        }        
        if(
DMRefund[Victim][CharID] != GetPVarInt(Victim"CharID")) {
            
SendClientMessage(playeridX11_TOMATO_2"User Character ID does not match refund information!");
            
resetRefundEnums(Victim);
            return 
1;
        } else {
            new 
health;
            
GetPlayerHealth(Victimhealth);
            if(
health <= 40) {
                
SendClientMessage(playeridX11_TOMATO_2"As a safety measure, Victim HP has been set too: 98.0");
                
SetPlayerHealthEx(Victim98);
            }
            
pot DMRefund[Victim][Pot];
            
coke DMRefund[Victim][Coke];
            
meth DMRefund[Victim][Meth];
            
matsa DMRefund[Victim][MatsA];
            
matsb DMRefund[Victim][MatsB];
            
matsc DMRefund[Victim][MatsC];
            
matsd DMRefund[Victim][MatsD];
            
matAPacks DMRefund[Victim][MatAPacks];
            
matBPacks DMRefund[Victim][MatBPacks];
            
matCPacks DMRefund[Victim][MatCPacks];
            
matDPacks DMRefund[Victim][MatDPacks];
            if(
pot <= 0)   { pot 0; }
            if(
coke <= 0)  { coke 0; }
            if(
meth <= 0)  { meth 0; }
            if(
matsa <= 0) { matsa 0; }
            if(
matsb <= 0) { matsb 0; }
            if(
matsc <= 0) { matsc 0; }
            if(
matsd <= 0) { matsd 0; }
            if(
matAPacks <= 0) { matAPacks 0; }
            if(
matBPacks <= 0) { matBPacks 0; }
            if(
matCPacks <= 0) { matCPacks 0; }
            if(
matDPacks <= 0) { matDPacks 0; }
            new 
CurrStuff;
            
CurrStuff GetPVarInt(Victim"Pot");
            
SetPVarInt(Victim"Pot"CurrStuff+pot);            
            
CurrStuff GetPVarInt(Victim"Coke");
            
SetPVarInt(Victim"Coke"CurrStuff+coke);        
            
CurrStuff GetPVarInt(Victim"Meth");            
            
SetPVarInt(Victim"Meth"CurrStuff+meth);
            
CurrStuff GetPVarInt(Victim"MatsA");
            
SetPVarInt(Victim"MatsA"CurrStuff+matsa);
            
CurrStuff GetPVarInt(Victim"MatsB");
            
SetPVarInt(Victim"MatsB"CurrStuff+matsb);
            
CurrStuff GetPVarInt(Victim"MatsC");
            
SetPVarInt(Victim"MatsC"CurrStuff+matsc);
            
CurrStuff GetPVarInt(Victim"MatsD");
            
SetPVarInt(Victim"MatsD"CurrStuff+matsd);
            
CurrStuff GetPVarInt(Victim"matAPacks");
            
SetPVarInt(Victim"MatAPacks"CurrStuff+matAPacks);
            
CurrStuff GetPVarInt(Victim"matBPacks");
            
SetPVarInt(Victim"MatBPacks"CurrStuff+matBPacks);
            
CurrStuff GetPVarInt(Victim"matCPacks");
            
SetPVarInt(Victim"MatCPacks"CurrStuff+matCPacks);
            
CurrStuff GetPVarInt(Victim"matDPacks");
            
SetPVarInt(Victim"MatDPacks"CurrStuff+matDPacks);
            
SendClientMessage(VictimX11_TOMATO_2msg);            
            
format(msgsizeof(msg), "User: %s - Drugs Refunded - Pot: %d, Coke:%d, Meth: %d"GetPlayerNameEx(VictimENameType_RPName_NoMask), potcokemeth);
            
SendClientMessage(playeridX11_TOMATO_2msg);
            
SendClientMessage(VictimX11_TOMATO_2msg);    
            
format(msgsizeof(msg), "User: %s - Materials Refunded - MatsA: %d, MatsB: %d, MatsC: %d, MatsD: %d"GetPlayerNameEx(VictimENameType_RPName_NoMask), matsamatsbmatscmatsd);
            
SendClientMessage(playeridX11_TOMATO_2msg);
            
SendClientMessage(VictimX11_TOMATO_2msg);    
            
format(msgsizeof(msg), "User: %s - Material Packs Refunded - matsAPacks: %d, matsCPacks: %d, matsCPacks: %d, matsDPacks: %d"GetPlayerNameEx(VictimENameType_RPName_NoMask), matAPacksmatBPacksmatCPacksmatDPacks);
            
SendClientMessage(playeridX11_TOMATO_2msg);
            
SendClientMessage(VictimX11_TOMATO_2msg);    
            
resetRefundEnums(Victim);
        }
    } else {
        
SendClientMessage(playeridX11_YELLOW_2"USAGE: /undodeath playerid");
        return 
1;
    }
    return 
1;

and the errors are shown in my first post
Reply


Messages In This Thread
errors - by LifeRah - 12.03.2016, 16:31
Re: errors - by Joron - 12.03.2016, 17:00
Re: errors - by Shaheen - 12.03.2016, 17:16
Re: errors - by saffierr - 12.03.2016, 17:18
Re: errors - by LifeRah - 12.03.2016, 17:28
Re: errors - by LifeRah - 13.03.2016, 01:31
Re: errors - by AndySedeyn - 13.03.2016, 01:33
Re: errors - by LifeRah - 13.03.2016, 13:10
Re: errors - by AndySedeyn - 13.03.2016, 13:20
Re: errors - by LifeRah - 14.03.2016, 16:11

Forum Jump:


Users browsing this thread: 1 Guest(s)