Ich habe ein Script der Funzt aber das Problemm ist wen ich /gefangen mache lande ich in der luft anstat im Knast die Koordinaten stimmen aber laut anderen Jail scripten bitte Helfen
////////////////////////////////////////////////////////////////////////////////
///////////////// Simple Jail/Unjail + Sicherung by ////////////////////////////
//////////////// FloRaX ////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
#include <a_samp>
new Jailed[MAX_PLAYERS];
forward Jail(playerid);
forward Unjail(playerid);
stock IsNumeric(const string[])
{
new length=strlen(string);
if (length==0) return false;
for (new i = 0; i < length; i++) {
if (
(string[i] > '9' || string[i] < '0' && string[i]!='-' && string[i]!='+')
|| (string[i]=='-' && i!=0)
|| (string[i]=='+' && i!=0)
) return false;
}
if (length==1 && (string[0]=='-' || string[0]=='+')) return false;
return true;
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Simple - Jail|Unjail by FloRaX ");
print("--------------------------------------\n");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[255], index;
cmd = strtok(cmdtext, index);
if (!strcmp("/gefangen",cmd,true,5)) {
{
new tmp[128];
tmp = strtok(cmdtext, index);
if(!strlen(tmp) || !IsNumeric(tmp)) {
return SendClientMessage(playerid,0x0000FFFF,"Benutzung: /gefangen [playerid]");
}
else {
new id=strval(tmp);
if(!IsPlayerConnected(id)) {
return SendClientMessage(playerid,0x0000FFFF,"Diesen Spieler gibt es nicht!");
}
else {
Jail(id);
SendClientMessage(id,0x00FFFFFF,"***Du wurdest ins Knast gesteckt!");
printf("ID: %d wurde soebend ins Knast !",id);
}
}
}
return 1;
}
if (!strcmp("/frei",cmd,true,5)) {
{
new tmp[128];
tmp = strtok(cmdtext, index);
if(!strlen(tmp) || !IsNumeric(tmp)) {
return SendClientMessage(playerid,0x0000FFFF,"Benutzung: /frei [playerid]");
}
else {
new id=strval(tmp);
if(!IsPlayerConnected(id)) {
return SendClientMessage(playerid,0x0000FFFF,"Diesen Spieler gibt es nicht!");
}
else {
Unjail(id);
SendClientMessage(id,0x00FFFFFF,"***Du bist wider Frei benehme dich das Nächste mal!");
printf("ID: %d wurde aus dem Knast entlassen",id);
}
}
}
return 1;
}
return 0;
}
public Jail(playerid)
{
if(IsPlayerConnected(playerid))
{
Jailed[playerid] = 1;
SetPlayerPos(playerid,197.7850,175.3622,1003.0234);
}
return 1;
}
public Unjail(playerid)
{
if(IsPlayerConnected(playerid))
{
Jailed[playerid] = 0;
SpawnPlayer(playerid);
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(Jailed[playerid] == 1)
{
Jail(playerid);
GameTextForPlayer(playerid,"~r~Du hast deine Strafe noch nicht abgesessen",6000,6);
}
return 1;
}