I'm new to programming in sourcepawn but I have a problem:
I get the error "Argument type missmatch" on line 33.
Code:
#include <sourcemod>
#include <sdktools>
public Plugin myinfo = {
name="ReportPlugin",
author="Olle Thunberg",
description = "Adds the reports to the database",
version = "1.0",
url = "http://www.sourcemod.net/"
}
public void OnPluginStart(){
RegConsoleCmd("sm_report", sm_report);
}
public Action:sm_report(int client, int args){
new String:reported[32];
GetCmdArg(1, reported, sizeof(reported));
if(client){
ReplyToCommand(client, "Reported the user: %s", reported);
new String:error[255];
new Handle:db = SQL_DefConnect(error, sizeof(error));
if(db == null){
PrintToServer("Failed to connect to database: %s", error);
return Plugin_Handled;
}else {
// FIXA MER HÄR IMORGON
// FIXA MER HÄR IMORGON
// FIXA MER HÄR IMORGON
if(!SQL_FastQuery(db, "UPDATE users SET reports = reports + 1 WHERE steamid = '%s'", reported)){
char error[255];
SQL_GetError(db, error, sizeof(error));
PrintToServer("Failed to query (error: %s)", error);
}
}
}
return Plugin_Handled;
}
I would love if someone could tell me what's wrong!