Fehler:
C:\Users\kevin\Desktop\server\gamemodes\self2.pwn(5743) : error 035: argument type mismatch (argument 3)
C:\Users\kevin\Desktop\server\gamemodes\self2.pwn(5741) : warning 203: symbol is never used: "wantedlevel"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
stock SetWantedLevel(playerid,wantedlevel)
{
mysql_SetInt(Tabelle_Spieler, "Wanteds","%d",wantedlevel, "Name",GetName(pID));
UpdateWantedDraw(playerid);
return 1;
}
Alles vom Wantedsystem:
forward WantedTimerPublic(playerid);
public WantedTimerPublic(playerid)
{
if(GetWantedLevel(playerid)>=1)
{
SetWantedLevel(playerid,GetWantedLevel(playerid)-1);
new str[200];
format(str,sizeof(str),"Du hast ein Wantedlevel verloren. Aktuelles Wantedlevel: %i", GetWantedLevel(playerid));
SendClientMessage(playerid, Rot, str);
return 1;
}return 1;
}
stock GetWantedLevel(playerid)
{
return GetPVarInt(playerid,"Wantedlevel");
}
stock SetWantedLevel(playerid,wantedlevel)
{
mysql_SetInt(Tabelle_Spieler, "Wanteds","%d",wantedlevel, "Name",GetName(pID));
UpdateWantedDraw(playerid);
return 1;
}
stock UpdateWantedDraw(playerid)
{
if(GetWantedLevel(playerid)>=1)
{
TextDrawHideForPlayer(playerid, Text:WantedTextdraw[playerid]);
new str[30];
format(str,sizeof(str),"%d",GetWantedLevel(playerid));
TextDrawSetString(Text:WantedTextdraw[playerid], str);
TextDrawShowForPlayer(playerid, Text:WantedTextdraw[playerid]);
}
return 1;
}
ocmd:wanted(playerid,params[])
{
new str[128], pID, wantedlevel;
if(sscanf(params, "ui", pID, wantedlevel))return SendClientMessage(playerid, Rot, "Benutze: /wanted [ID] [Wanteds]");
if(IsPlayerConnected(pID))
{
if(!IsPlayerNPC(pID))
{
format(str,sizeof(str),"Du gibst %s [ID: %i] %i Wanted(s).", GetName(pID), pID, wantedlevel);
SendClientMessage(playerid, Rot, str);
SetWantedLevel(pID,GetWantedLevel(pID)+wantedlevel);
format(str,sizeof(str),"Du erhälst %i Wanted(s) von der Polizei. Aktuelles Wantedlevel: %i", wantedlevel, GetWantedLevel(playerid));
SendClientMessage(pID, Rot, str);
return 1;
}else return SendClientMessage(playerid,Rot,"Du kannst einem NPC keine Wanteds geben.");
}else return SendClientMessage(playerid,Rot,"Spieler ist nicht connected.");
}
ocmd:wantedlist(playerid,params[])
{
new string[64];
SendClientMessage(playerid, Rot,"-----Wanted - Liste-----");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(!IsPlayerNPC(i))
{
if(GetWantedLevel(i) >=1)
{
format(string, sizeof(string), "%s - Wanteds: %d", GetName(i), GetWantedLevel(i));
SendClientMessage(playerid, Rot,string);
}
}
}
}
return 1;
}
ocmd:clearwanted(playerid,params[])
{
new str[128], pID;
if(sscanf(params, "u", pID))return SendClientMessage(playerid, Rot, "Benutze: /clearwanted [ID]");
if(IsPlayerConnected(pID))
{
if(!IsPlayerNPC(pID))
{
format(str,sizeof(str),"Du clearst die Wanteds von %s [ID: %i].", GetName(pID), pID);
SendClientMessage(playerid, Rot, str);
SendClientMessage(pID, Rot, "Deine Wanteds wurden von der Polizei gecleart.");
SetWantedLevel(pID,0);
return 1;
}else return SendClientMessage(playerid,Rot,"Du kannst einem NPC keine Wanteds geben.");
}else return SendClientMessage(playerid,Rot,"Spieler ist nicht connected.");
}