Hallo liebe Scripter,
Ich habe ein Problem mit meinem Stoporten.
if(strcmp(cmd, "/stoporten",true) == 0)
{
if(IsACop(playerid))
{
KillTimer(OrtenTimer(playerid));
SendClientMessage(playerid,COLOR_GRAD1,"Ortung beendet.");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "Du bist kein Cop!");
}
return 1;
}
Das mit dem orten fängt so an
if(strcmp(cmd, "/autoorten", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(!IsACop(playerid))
{
SendClientMessage(playerid, COLOR_GREY, "Du bist kein Polizist!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutzung: /autoorten [Spieler ID]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PhoneOnline[giveplayerid] > 0)
{
SendClientMessage(playerid,COLOR_RED,"Das Handy von %s ist ausgeschaltet",giveplayerid);
return 1;
}
if(giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_GREY, "Du kannst dich nicht selbst finden!");
return 1;
}
new Float:X,Float:Y,Float:Z;
GetPlayerPos(giveplayerid, X,Y,Z);
SetPlayerCheckpoint(playerid, X,Y,Z, 6);
SetTimerEx("OrtenTimer",3000,1,"ii",playerid,giveplayerid);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"/stoporten zum beenden.");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Falsche ID");
}
}
}
Der timer ist so
forward OrtenTimer(playerid,giveplayerid);
public OrtenTimer(playerid,giveplayerid)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(giveplayerid, X,Y,Z);
SetPlayerCheckpoint(playerid, X,Y,Z, 3);
return 1;
}