Guten Tag,
ich habe das Problhem wenn ich eine Player id orte das der Checkpoint nach 6 sekunden weg geht.
wie muss ich den timer defenieren das der Checkpoint den spieler verfolgen tuhn.
COMMAND:orten(playerid,params[])
{
if(ImTutorial[playerid] != 0)return ImTutorial_MSG(playerid);
if(GetPVarInt(playerid,"Eingeloggt") == 0)return Eingeloggt_MSG(playerid);
if(Spieler[playerid][pAWAYFROMKEYBOARD] == 1)return AFK_MSG(playerid);
if(Spieler[playerid][pInPrison] == 1)return Prison_MSG(playerid);
if(Spieler[playerid][pFriedhof] == 1)return TOT_MSG(playerid);
if(Spieler[playerid][pDeath] == 1)return DAMAGE_MSG(playerid);
if(Spieler[playerid][pJailed] != 0)return KNAST_MSG(playerid);
if(Spieler[playerid][pTazerd] == 1)return TAZER_MSG(playerid);
if(Spieler[playerid][pCuffed] == 1)return CUFF_MSG(playerid);
new pID,nummer,ortungsstring[128],Float:x,Float:y,Float:z;
if(isPlayerInFrakt(playerid,1) || isPlayerInFrakt(playerid,6) || isPlayerInFrakt(playerid,2) || isPlayerInFrakt(playerid,16))
{
if(Spieler[playerid][pOrtungsgeraet] == 0)return SCM(playerid,SAMP_WEISS,"Kein Ortungsgerät dabei.");
if(sscanf(params,"u",pID))return SCM(playerid,SAMP_WEISS,""IINFO" /orten UserID");
if(IsHandyNummerEnable(nummer) == -0)return SCM(playerid,SAMP_WEISS,"Nicht ortbar.");
format(ortungsstring,sizeof(ortungsstring),""IINFO" du versuchst %s (ID:%i) zu orten...",SpielerName(pID),pID);
SCM(playerid,SAMP_WEISS,ortungsstring);
//if(Spieler[pID][pHandy] == 0)return SCM(playerid,SAMP_WEISS,"Nicht ortbar.");
//if(Spieler[pID][pHandystate] == 0)return SCM(playerid,SAMP_WEISS,"Nicht ortbar.");
if(Spieler[pID][pDeath] == 1)return SCM(playerid,SAMP_WEISS,"Nicht ortbar.");
if(Spieler[pID][pFriedhof] == 1)return SCM(playerid,SAMP_WEISS,"Nicht ortbar.");
format(ortungsstring,sizeof(ortungsstring),""IINFO" du hast %s (ID:%i) geortet. Nutze '/delcheck' um den Checkpoint zu entfernen.",SpielerName(pID),pID);
SCM(playerid,SAMP_WEISS,ortungsstring);
KillTimer(SpielerOrtenTimer[playerid]);
GetPlayerPos(pID,x,y,z);
SetPlayerCheckpoint(playerid,x,y,z,3);
Spieler[playerid][pOrtenVehORPlayer] = 1;//1 playerid 2 veh 3 service accept
Spieler[playerid][pOrtenVehIDplayerid] = pID;
SpielerOrtenTimer[playerid] = SetTimerEx("SpielerOderFahrzeugOrten",6000,1,"iii",playerid,pID,1);
Spieler[playerid][pIsearch] = 1;
return 1;
}
return SCM(playerid,SAMP_WEISS,""IINFO" du bist nicht in der jeweiligen Fraktion.");
}
public OnPlayerEnterCheckpoint(playerid)
{
new vehicleid = GetPlayerVehicleID(playerid),string[256];
if(Spieler[playerid][pInPrison] == 1)
{
new rSpawn = random(sizeof(Prisoncheckpoints));
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,Prisoncheckpoints[rSpawn][0],Prisoncheckpoints[rSpawn][1],Prisoncheckpoints[rSpawn][2],1.0);
Spieler[playerid][pPrisonCPsgelaufen]--;
format(string,sizeof(string),"~w~Checkpoints: ~y~%i von ~r~%i",Spieler[playerid][pPrisonCPsgelaufen],Spieler[playerid][pPrisonCPsgegeben]);
PlayerTextDrawSetString(playerid,PRISONdraw[playerid],string);
if(Spieler[playerid][pPrisonCPsgelaufen] <= 0)
{
StopAudioStreamForPlayer(playerid);
RemovePlayerAttachedObject(playerid,0);
Spieler[playerid][pPrisonDMWarns] = 0;
Spieler[playerid][pPrisonCPsgelaufen] = 0;
Spieler[playerid][pPrisonCPsgegeben] = 0;
Spieler[playerid][pInPrison] = 0;
SetPlayerVirtualWorld(playerid,0);
SCM(playerid,SAMP_WEISS,""IINFO" du hast deine Strafe beendet, benehme dich in Zukunft!");
DisablePlayerCheckpoint(playerid);
SpawnPlayerEx(playerid);
}
return 1;
}
if(CP_MakeRace[playerid] == true)
{
return 0;
}
if(Spieler[playerid][pTutMissionComplete][0] == true)
{
//(Quest Step 1(Teil 1))
DisablePlayerCheckpoint(playerid);
tutorialpickup[playerid][0] = CreateDynamicPickup(1550,1,3562.4568,-987.5737,618.4721,GetPlayerVirtualWorld(playerid));
SetPlayerPos(playerid,3562.4568,-987.5737,618.4721);
Spieler[playerid][pTutTimer4All] = SetTimerEx("Tutorial4All",2500,0,"ii",playerid,4);
TogglePlayerControllable(playerid,0);
SpamChat(playerid,0);
return 1;
}
if(Spieler[playerid][pTutMissionComplete][1] == true)
{
//(Quest Step 1(Teil 2))
DisablePlayerCheckpoint(playerid);
tutorialpickup[playerid][1] = CreateDynamicPickup(1461,1,3562.4568,-987.5737,618.4721,GetPlayerVirtualWorld(playerid));
SetPlayerPos(playerid,3562.4568,-987.5737,618.4721);
Spieler[playerid][pTutTimer4All] = SetTimerEx("Tutorial4All",5000,0,"ii",playerid,4);
TogglePlayerControllable(playerid,0);
return 1;
}
if(Spieler[playerid][pTutMissionComplete][2] == true)
{
//(Quest Step 1(Teil 3))
DisablePlayerCheckpoint(playerid);
Spieler[playerid][pTutMissionComplete][2] = false;
//SCM(playerid,SAMP_WEISS,""#HTML_BLAU"Pilot"#HTML_WEISS": Okay, wir sind nun über Los-Santos machen sie sich absprung bereit!");
SetPlayerPos(playerid,3562.4568,-987.5737,618.4721);
Spieler[playerid][pTutTimer4All] = SetTimerEx("Tutorial4All",5000,0,"ii",playerid,4);
TogglePlayerControllable(playerid,0);
SetPlayerCheckpoint(playerid,3562.4568,-987.5737,618.4721,3.0);
Spieler[playerid][pTutMissionComplete][3] = true;
return 1;
}
if(Spieler[playerid][pTutMissionComplete][3] == true)
{
DisablePlayerCheckpoint(playerid);
for(new i=3;i<154;i++)
{
DestroyPlayerObject(playerid,Spieler[playerid][pTutorialObject][i]);
}
//(Quest Step 1(Teil 4))
Spieler[playerid][pTutMissionComplete][3] = false;
SetPlayerVirtualWorld(playerid,0);
SetPlayerPos(playerid,3562.4568,-987.5737,618.4721);
Spieler[playerid][pTutTimer4All] = SetTimerEx("Tutorial4All",1000,1,"ii",playerid,5);
TogglePlayerControllable(playerid,0);
Spieler[playerid][pTutMissionComplete][4] = true;
SetPVarInt(playerid,"Eingeloggt",1);
SetTimerEx("SpielerFertig",15000,0,"i",playerid);
}
if(Spieler[playerid][pBuyVehicleCP] == 1)
{
PlayerPlaySound(playerid,1058,0.0,0.0,0.0);
DisablePlayerCheckpoint(playerid);
SCM(playerid,SAMP_WEISS,"Fahrzeug Befehle:");
SCM(playerid,SAMP_WEISS,"- '/pveh' um dein Fahrzeug zu verwalten");
SCM(playerid,SAMP_WEISS,"Weiteres in '/hilfe'");
Spieler[playerid][pBuyVehicleCP] = 0;
}
if(Spieler[playerid][pFBuyCheckPoint] == 1)
{
PlayerPlaySound(playerid,1058,0.0,0.0,0.0);
DisablePlayerCheckpoint(playerid);
SCM(playerid,SAMP_WEISS,"Fraktionfahrzeug Befehle:");
SCM(playerid,SAMP_WEISS,"- '/flock' zum Auf- und Abschließen einzelner Fraktionsfahrzeuge");
SCM(playerid,SAMP_WEISS,"- '/fparken' zum Parken einzelner Fraktionsfahrzeuge");
SCM(playerid,SAMP_WEISS,"- '/frespawn' zum Respawn aller Fraktionsfahrzeuge der Gang/Mafia/Fraktion");
SCM(playerid,SAMP_WEISS,"- '/fvehlist' gibt Info´s zu Fraktionfahrzeugen (Fahrzeugname,Tankzustand,Abgeschleppt:Ja/Nein,Status:Abgeschlossen/Aufgeschlossen)");
Spieler[playerid][pFBuyCheckPoint] = 0;
}
if(Spieler[playerid][pWaitEating] == 1)
{
DisablePlayerCheckpoint(playerid);
SCM(playerid,SAMP_WEISS,""IINFO" warte einen Moment! Dein Essen wird zubereitet.");
TogglePlayerControllable(playerid,0);
SetTimerEx("DriveIn",5000,0,"i",playerid);
if(Spieler[playerid][pIsearch] == 1)
{
new Float:x,Float:y,Float:z;
if(Spieler[playerid][pOrtenVehORPlayer] == 1)//ortet player
{
GetPlayerPos(Spieler[playerid][pOrtenVehIDplayerid],x,y,z);
SetPlayerCheckpoint(playerid,x,y,z,3);
SpielerOrtenTimer[playerid]=SetTimerEx("SpielerOderFahrzeugOrten",1000,1,"iii",playerid,Spieler[playerid][pOrtenVehIDplayerid],1);
return 1;
}
if(Spieler[playerid][pOrtenVehORPlayer] == 2)//ortet fahrzeug
{
GetVehiclePos(Spieler[playerid][pOrtenVehIDplayerid],x,y,z);
SetPlayerCheckpoint(playerid,x,y,z,3);
SpielerOrtenTimer[playerid]=SetTimerEx("SpielerOderFahrzeugOrten",1000,1,"iii",playerid,Spieler[playerid][pOrtenVehIDplayerid],2);
return 1;
}
if(Spieler[playerid][pOrtenVehORPlayer] == 3)//service accept
{
GetPlayerPos(Spieler[playerid][pOrtenVehIDplayerid],x,y,z);
SetPlayerCheckpoint(playerid,x,y,z,3);
GameTextForPlayer(playerid,"~g~Fahre zum Einsatzort",2500,1);
return 1;
}
}
}
if(Spieler[playerid][pIsearch] == 1)
{
PlayerPlaySound(playerid,1058,0.0,0.0,0.0);
KillTimer(SpielerOrtenTimer[playerid]);
Spieler[playerid][pOrtenVehORPlayer] = 0;//1 playerid 2 veh 3 service accept
Spieler[playerid][pOrtenVehIDplayerid] = -1;
DisablePlayerCheckpoint(playerid);
//TextDrawShowForPlayer(playerid,InfoSign);
//PlayerTextDrawSetString(playerid,INFOdraw[playerid][2],"~r~Info:~w~~n~Ziel erreicht!");
//PlayerTextDrawShow(playerid,INFOdraw[playerid][2]);
//SetTimerEx("HideInfoBox",3000,0,"i",playerid);
SCM(playerid,SAMP_WEISS,""IINFO" Ziel erreicht!");
Spieler[playerid][pIsearch] = 0;
}
DAnke im vorraus.
MFG