Hey,
wo definierst du KTime? und Wie
[b]SetTimerEx("UnPrison",KTime[playerid],0,"i",playerid);[/b]
Ich glaube bei dir Fehlt bei KTime das playerid
new pid;
new KTime[128];
Am anfang des Befehls (arrest)
Hierist der ganze Code
ocmd:arrestpl(playerid,params[])
{
new pid;
new KTime[128];
if(gTeam[playerid] == 2 || IsACop(playerid) || PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
{
if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " Du bist nicht im Dienst!");
return 1;
}
if(IsPlayerInRangeOfPoint(playerid,3.0, 198.0591,159.2369,1003.0234))
{
if(IsACop(pid))
{
SendClientMessage(playerid, COLOR_GRAD2, " Du kannst keinen Beamten einsperren!");
return 1;
}
}
if(GetDistanceBetweenPlayers(playerid,pid) < 5)
{
if(WantedLevel[pid] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Der Spieler ist nicht gesucht!");
return 1;
}
new string[128];
format(string, sizeof(string), "* Du hast %s eingesperrt für $%d Sekunden.!", GetName(pid),PlayerInfo[pid][pJailTime]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
//GivePlayerMoney(pid, -moneys);
format(string, sizeof(string), "Eingesperrt von %s ~n~ fuer $%d Sekunden", GetName(pid), PlayerInfo[pid][pJailTime]);
GameTextForPlayer(pid, string, 5000, 5);
ResetPlayerWeapons(pid);
//PlayerInfo[pid][WantedLevel] = KTime
WantedLevel[pid] = KTime[playerid];
PlayerInfo[pid][pJailTime] = KTime[playerid] * 60;
SetTimerEx("UnPrison",KTime,0,"i",playerid);
//PlayerInfo[pid][pJailTime] = KTime * 60
//WantedPoints[killerid] += 2
if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1)
{
format(string, sizeof(string), "<< LS Officer %s hat den Verdächtigen %s eingesperrt >>", GetName(playerid), GetName(pid));
OOCNews(COLOR_LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
{
format(string, sizeof(string), "<< SF Officer %s hat den Verdächtigen %s eingesperrt >>", GetName(playerid), GetName(pid));
OOCNews(COLOR_LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember]==3||PlayerInfo[playerid][pLeader]==3)
{
format(string, sizeof(string), "<< Soldat %s hat den Verdächtigen %s eingesperrt >>", GetName(playerid), GetName(pid));
OOCNews(COLOR_LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember]==21||PlayerInfo[playerid][pLeader]==21)
{
format(string, sizeof(string), "<< FBI-Agent %s hat den Verdächtigen %s eingesperrt >>", GetName(playerid), GetName(pid));
OOCNews(COLOR_LIGHTRED, string);
}
PlayerInfo[pid][pJailed] = 1;
PlayerInfo[pid][pArrested] += 1;
SetPlayerInterior(pid, 3);
SetPlayerFree(pid,playerid, "Verhaftet");
WantedPoints[pid] = 0;
WantedLevel[pid] = 0;
SetPlayerWantedLevel(pid,0);
WantLawyer[pid] = 1;
}
else
{
SendClientMessage(playerid,-1,"Du bist kein Beamter.");
}
}
return 1;
}