forward DMRefundOnLogout(playerid);
forward OnDeathMatchRecord(shooter, victim);
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 pot, coke, meth, matsa, matsb, matsc, matsd, matAPacks, matBPacks, matCPacks, matDPacks, msg[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(victim, X11_TOMATO_2, "If you were DM'd and no admins are on. TAKE A SCREEN SHOT NOW!");
format(msg, sizeof(msg), "You: %s were killed by %s", GetPlayerNameEx(victim, ENameType_RPName_NoMask), DMRefund[victim][WhoKilledVictim]);
SendClientMessage(victim, X11_TOMATO_2, msg);
format(msg, sizeof(msg), "You: %s", GetPlayerNameEx(victim, ENameType_RPName_NoMask));
SendClientMessage(victim, X11_TOMATO_2, msg);
format(msg, sizeof(msg), "You: %s - Lost Drugs - Pot: %d, Coke: %d, Meth: %d", GetPlayerNameEx(victim, ENameType_RPName_NoMask), pot, coke, meth);
SendClientMessage(victim, X11_TOMATO_2, msg);
format(msg, sizeof(msg), "You: %s - Lost Materials - MatsA: %d, MatsB: %d, MatsC: %d, MatsD: %d", GetPlayerNameEx(victim, ENameType_RPName_NoMask), matsa, matsb, matsc, matsd);
SendClientMessage(victim, X11_TOMATO_2, msg);
format(msg, sizeof(msg), "You: %s - Lost Material Packs - matsAPacks: %d, matsCPacks: %d, matsCPacks: %d, matsDPacks: %d", GetPlayerNameEx(victim, ENameType_RPName_NoMask), matAPacks, matBPacks, matCPacks, matDPacks);
SendClientMessage(victim, X11_TOMATO_2, msg);
return 1;
}
public OnDeathMatchRecord(shooter, victim) {
if(isInPaintball(victim) || IsPlayerInEvent(victim) || isPlayerDying(victim) || (IsAnLEO(victim) && IsOnDuty(victim)) || isBoxing(victim)) {
return 1;
}
new name[128];
name = GetPlayerNameEx(shooter, ENameType_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(playerid, params[], help) {
if(help) {
SendClientMessage(playerid, X11_YELLOW_2, "USAGE: /checkdeath playerid");
return 1;
}
new victim;
new pot, coke, meth, matsa, matsb, matsc, matsd, matAPacks, matBPacks, matCPacks, matDPacks, msg[128];
if(!sscanf(playerid,params, "k<playerLookup_acc>", victim)) {
if(!IsPlayerConnectEx(victim)) {
SendClientMessage(playerid, X11_TOMATO_2 ,"User not found.");
return 1;
}
if(DMRefund[victim][HasDied] != 1) {
SendClientMessage(playerid, X11_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(msg, sizeof(msg), "User: %s was killed by %s", GetPlayerNameEx(victim, ENameType_RPName_NoMask), DMRefund[victim][WhoKilledVictim]);
SendClientMessage(playerid, X11_TOMATO_2, msg);
SendClientMessage(playerid, X11_TOMATO_2, msg);
format(msg, sizeof(msg), "User: %s - Lost Drugs - Pot: %d, Coke: %d, Meth: %d", GetPlayerNameEx(victim, ENameType_RPName_NoMask), pot, coke, meth);
SendClientMessage(playerid, X11_TOMATO_2, msg);
format(msg, sizeof(msg), "User: %s - Lost Materials - MatsA: %d, MatsB: %d, MatsC: %d, MatsD: %d", GetPlayerNameEx(victim, ENameType_RPName_NoMask), matsa, matsb, matsc, matsd);
SendClientMessage(playerid, X11_TOMATO_2, msg);
format(msg, sizeof(msg), "User: %s - Lost Material Packs - matsAPacks: %d, matsCPacks: %d, matsCPacks: %d, matsDPacks: %d", GetPlayerNameEx(victim, ENameType_RPName_NoMask), matAPacks, matBPacks, matCPacks, matDPacks);
SendClientMessage(playerid, X11_TOMATO_2, msg);
}
} else {
SendClientMessage(playerid, X11_YELLOW_2, "USAGE: /checkdeath playerid");
return 1;
}
return 1;
}
YCMD:undodeath(playerid, params[], help) {
if(help) {
SendClientMessage(playerid, X11_YELLOW_2, "USAGE: /undodeath playerid");
return 1;
}
new Victim;
new pot, coke, meth, matsa, matsb, matsc, matsd, matAPacks, matBPacks, matCPacks, matDPacks, msg[128];
if(!sscanf(playerid,params, "k<playerLookup_acc>", Victim)) {
if(!IsPlayerConnectEx(Victim)) {
SendClientMessage(playerid, X11_TOMATO_2 ,"User not found.");
return 1;
}
if(playerid == Victim) {
SendClientMessage(playerid, X11_TOMATO_2, "You cannot use this on yourself!");
return 1;
}
if(DMRefund[Victim][HasDied] != 1 || DMRefund[Victim][HasDied] == -1) {
SendClientMessage(playerid, X11_TOMATO_2, "This user has not been killed recently");
return 1;
}
if(DMRefund[Victim][CharID] != GetPVarInt(Victim, "CharID")) {
SendClientMessage(playerid, X11_TOMATO_2, "User Character ID does not match refund information!");
resetRefundEnums(Victim);
return 1;
} else {
new health;
GetPlayerHealth(Victim, health);
if(health <= 40) {
SendClientMessage(playerid, X11_TOMATO_2, "As a safety measure, Victim HP has been set too: 98.0");
SetPlayerHealthEx(Victim, 98);
}
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(Victim, X11_TOMATO_2, msg);
format(msg, sizeof(msg), "User: %s - Drugs Refunded - Pot: %d, Coke:%d, Meth: %d", GetPlayerNameEx(Victim, ENameType_RPName_NoMask), pot, coke, meth);
SendClientMessage(playerid, X11_TOMATO_2, msg);
SendClientMessage(Victim, X11_TOMATO_2, msg);
format(msg, sizeof(msg), "User: %s - Materials Refunded - MatsA: %d, MatsB: %d, MatsC: %d, MatsD: %d", GetPlayerNameEx(Victim, ENameType_RPName_NoMask), matsa, matsb, matsc, matsd);
SendClientMessage(playerid, X11_TOMATO_2, msg);
SendClientMessage(Victim, X11_TOMATO_2, msg);
format(msg, sizeof(msg), "User: %s - Material Packs Refunded - matsAPacks: %d, matsCPacks: %d, matsCPacks: %d, matsDPacks: %d", GetPlayerNameEx(Victim, ENameType_RPName_NoMask), matAPacks, matBPacks, matCPacks, matDPacks);
SendClientMessage(playerid, X11_TOMATO_2, msg);
SendClientMessage(Victim, X11_TOMATO_2, msg);
resetRefundEnums(Victim);
}
} else {
SendClientMessage(playerid, X11_YELLOW_2, "USAGE: /undodeath playerid");
return 1;
}
return 1;
}
You have to include the libraries that you use. Especially a_samp.inc, it's the base of your gamemode as it holds all the basic native functions you need to create a gamemode.
|
#include <a_samp>
#include <YSI\y_commands>
// This is when the included file is in the same directory as the file in which you include it
#include "a_file_in_the_same_directory.pwn"
// This is when there's a folder called: "modules" with in it the file you want to include
#include "modules\a_file_in_another_directory.pwn"
D:\GTA SanAndreas\filterscripts\DMREFUND.pwn(82) : error 035: argument type mismatch (argument 2)
D:\GTA SanAndreas\filterscripts\DMREFUND.pwn(83) : error 017: undefined symbol "ENameType_RPName_NoMask"
D:\GTA SanAndreas\filterscripts\DMREFUND.pwn(84) : error 035: argument type mismatch (argument 2)
D:\GTA SanAndreas\filterscripts\DMREFUND.pwn(85) : error 017: undefined symbol "ENameType_RPName_NoMask"
D:\GTA SanAndreas\filterscripts\DMREFUND.pwn(86) : error 035: argument type mismatch (argument 2)
D:\GTA SanAndreas\filterscripts\DMREFUND.pwn(87) : error 017: undefined symbol "ENameType_RPName_NoMask"
D:\GTA SanAndreas\filterscripts\DMREFUND.pwn(88) : error 035: argument type mismatch (argument 2)
D:\GTA SanAndreas\filterscripts\DMREFUND.pwn(89) : error 017: undefined symbol "ENameType_RPName_NoMask"
D:\GTA SanAndreas\filterscripts\DMREFUND.pwn(90) : error 035: argument type mismatch (argument 2)
D:\GTA SanAndreas\filterscripts\DMREFUND.pwn(91) : error 017: undefined symbol "ENameType_RPName_NoMask"
D:\GTA SanAndreas\filterscripts\DMREFUND.pwn(92) : error 035: argument type mismatch (argument 2)
D:\GTA SanAndreas\filterscripts\DMREFUND.pwn(96) : error 017: undefined symbol "isInPaintball"
D:\GTA SanAndreas\filterscripts\DMREFUND.pwn(100) : error 017: undefined symbol "ENameType_RPName_NoMask"
D:\GTA SanAndreas\filterscripts\DMREFUND.pwn(100) : error 033: array must be indexed (variable "name")
D:\GTA SanAndreas\filterscripts\DMREFUND.pwn(122) : error 017: undefined symbol "X11_YELLOW_2"
D:\GTA SanAndreas\filterscripts\DMREFUND.pwn(127) : error 017: undefined symbol "sscanf"
D:\GTA SanAndreas\filterscripts\DMREFUND.pwn(128) : error 017: undefined symbol "IsPlayerConnectEx"
D:\GTA SanAndreas\filterscripts\DMREFUND.pwn(129) : error 029: invalid expression, assumed zero
D:\GTA SanAndreas\filterscripts\DMREFUND.pwn(129) : warning 215: expression has no effect
D:\GTA SanAndreas\filterscripts\DMREFUND.pwn(129) : error 001: expected token: ";", but found ")"
D:\GTA SanAndreas\filterscripts\DMREFUND.pwn(129) : error 029: invalid expression, assumed zero
D:\GTA SanAndreas\filterscripts\DMREFUND.pwn(129) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
21 Errors.