#define FILTERSCRIPT #include <a_samp> #include <Dini> #include <Dutils> #include <Dudb> #define savefolder "/save/%s.ini" #pragma unused ret_memcpy new Killz[MAX_PLAYERS]; new Deathz[MAX_PLAYERS]; public OnFilterScriptInit() { print("\n--------------------------------------"); print(" Blank Filterscript by your name here"); print("--------------------------------------\n"); return 1; } public OnPlayerConnect(playerid) { new pname[128]; new file[128]; GetPlayerName(playerid, pname, sizeof(pname)); format(file, sizeof(file), savefolder,pname); if(!dini_Exists(file)) { dini_Create(file); dini_IntSet(file, "Score", 0); dini_IntSet(file, "Money", 0); dini_IntSet(file, "Kills", Killz[playerid]); dini_IntSet(file, "Deaths", Deathz[playerid]); SetPlayerScore(playerid, dini_Int(file, "Score")); SetPlayerMoney(playerid, dini_Int(file, "Money")); } else { SetPlayerScore(playerid, dini_Int(file, "Score")); SetPlayerMoney(playerid, dini_Int(file, "Money")); SetPlayerSkin(playerid, dini_Int(file, "Skin")); } return 1; } public OnPlayerDisconnect(playerid, reason) { new pname[128]; new file[128]; GetPlayerName(playerid, pname, sizeof(pname)); format(file, sizeof(file), savefolder,pname); if(!dini_Exists(file)) { } else { dini_IntSet(file, "Score", GetPlayerScore(playerid)); dini_IntSet(file, "Money", GetPlayerMoney(playerid)); dini_IntSet(file, "Kills", Killz[playerid]); dini_IntSet(file, "Deaths", Deathz[playerid]); } return 1; } public OnPlayerDeath(playerid, killerid, reason) { Killz[killerid] ++; Deathz[playerid] ++; return 1; }
CMD:stats(playerid,params[])
{
new string[32];
format(string,sizeof(string),"Kill: %d",Killz[playerid]);
SendClientMessage(playerid,-1,string);
format(string,sizeof(string),"Death: %d",Deathz[playerid]);
SendClientMessage(playerid,-1,string);
return 1;
}
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1 public OnPlayerCommandText(playerid, cmdtext[]) { dcmd(stats, 5, cmdtext); } dcmd_stats(playerid,params[]) { #pragma unused params new string[32]; format(string,sizeof(string),"Kill: %d",Killz[playerid]); SendClientMessage(playerid,-1,string); format(string,sizeof(string),"Death: %d",Deathz[playerid]); SendClientMessage(playerid,-1,string); return 1; }
#include <sscanf2> #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1 public OnPlayerCommandText(playerid, cmdtext[]) { dcmd(stats, 3, cmdtext); return 1; } dcmd_stats(playerid, params[]) { new string[32]; format(string,sizeof(string),"Kill: %d",Killz[playerid]); SendClientMessage(playerid,-1,string); format(string,sizeof(string),"Death: %d",Deathz[playerid]); SendClientMessage(playerid,-1,string); return 1; }
C:\Users\Chaccour\Desktop\CS\filterscripts\savings.pwn(80) : warning 203: symbol is never used: "params"
#pragma unused params
I already got #pragma unused params
I want the stats to show in one line, no 2 lines |
dcmd_stats(playerid, params[])
{
#pragma unused params
new string[32];
format(string,sizeof(string),"Kills: %d Deaths: %d",Killz[playerid],Deathz[playerid]);
SendClientMessage(playerid,-1,string);
return 1;
}