Hallo Breadfish
Ich hab versucht es so zu scripten dass man nur in einem Copcar jemanden orten kann aber leider klappt es nicht.
Was mache ich falsch???
if(strcmp(cmd, "/orten", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(!IsACop(playerid))
{
SendClientMessage(playerid, rot, "Du bist kein Polizist!");
return 1;
}
if(gTeam[playerid] == 2 || IsACop(playerid)|| IsAbf(playerid))
{
new tmpcar = GetPlayerVehicleID(playerid);
if(IsACopCar(tmpcar))
{
SendClientMessage(playerid, rot, "Du bist in keinem PD-Wagen!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /orten [Spieler ID]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(giveplayerid, X,Y,Z);
SetPlayerCheckpoint(playerid, X,Y,Z, 3);
}
}
else
{
SendClientMessage(playerid,rot, "Falsche ID");
}
}
return 1;
}