hallo ,
Ich habe folgendes Problem :
Wenn ich als Cop /grab [ID] eingebe wird der spieler ins Auto gezogen.
Aber wenn ich dann /eject [ID] eingebe bekommt der Spieler den ich /eject gemacht habe eine Exe (GameCrash)
ZitatAlles anzeigen/grab :
if(strcmp(cmd, "/grab", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /grab [ID]");
return 1;
}
if(gTeam[playerid] == 2 PlayerInfo[playerid][pMember] == 1 PlayerInfo[playerid][pLeader] == 1 PlayerInfo[playerid][pLeader] == 2 PlayerInfo[playerid][pLeader] == 3 PlayerInfo[playerid][pLeader] == 3)
{
new person;
person = strval(tmp);
if(IsPlayerConnected(person))
{
if(person != INVALID_PLAYER_ID)
{
if(GetDistanceBetweenPlayers(playerid,person) <=
{
if(IsPlayerInAnyVehicle(person))
{
SendClientMessage(playerid, COLOR_GREY, " Ziel ist in einem Auto!");
return 1;
}
if(person == playerid) { SendClientMessage(playerid, COLOR_GREY, "Du kannst dich nicht selbst grabben!"); return 1; }
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == 2)
{
new playerVehicle = GetPlayerVehicleID(playerid);
PutPlayerInVehicle(person, playerVehicle, 3);
GetPlayerName(person, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Du wurdest von %s ins Farzeug gezogen.", sendername);
SendClientMessage(person, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Du hast %s ins Fahrzeug gezogen.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s hat %s ins Fahrzeug gezogen", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
TogglePlayerControllable(person, 0);
PlayerCuffed[person] = 2;
PlayerCuffedTime[person] = 180;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Du fährst kein Auto!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Spieler ist nicht in deine Nähe!");
return 1;
}
}
}
}
else if(PlayerInfo[playerid][pMember] == 5 PlayerInfo[playerid][pLeader] == 5 PlayerInfo[playerid][pMember] == 6 PlayerInfo[playerid][pLeader] == 6 PlayerInfo[playerid][pMember] == 8 PlayerInfo[playerid][pLeader] ==
{
if(PlayerInfo[playerid][pRank] < 4)
{
SendClientMessage(playerid, COLOR_GREY, "Du brauchst Rang 4 oder höher! !");
return 1;
}
new person;
person = strval(tmp);
if(IsPlayerConnected(person))
{
if(person != INVALID_PLAYER_ID)
{
if(GetDistanceBetweenPlayers(playerid,person) <=
{
if(IsPlayerInAnyVehicle(person))
{
SendClientMessage(playerid, COLOR_GREY, "Ziel ist in einem Auto!");
return 1;
}
if(person == playerid) { SendClientMessage(playerid, COLOR_GREY, "Du kannst dich nicht selbst grabben!"); return 1; }
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == 2)
{
new playerVehicle = GetPlayerVehicleID(playerid);
PutPlayerInVehicle(person, playerVehicle, 3);
GetPlayerName(person, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Du wurdest in ein Farzeug gezogen.", sendername);
SendClientMessage(person, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Du hast %s ins Fahrzeug gezogen.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GameTextForPlayer(giveplayerid, "~r~gefesselt", 2500, 3);
TogglePlayerControllable(person, 0);
PlayerCuffed[person] = 2;
PlayerCuffedTime[person] = 240;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Du fährst kein Auto!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Spieler ist nicht in deine Nähe!");
return 1;
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Du bist kein Cop / FBI / Soldat / Mafiosi!");
}
}
return 1;
}
ZitatAlles anzeigen/eject :
if(strcmp(cmd, "/eject", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new State;
if(IsPlayerInAnyVehicle(playerid))
{
State=GetPlayerState(playerid);
if(State!=PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid,COLOR_GREY," Du kannst nur als Fahrer Leute aus dem Auto werfen !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /eject [playerid]");
return 1;
}
new playa;
playa = ReturnUser(tmp);
new test;
test = GetPlayerVehicleID(playerid);
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
if(playa == playerid) { SendClientMessage(playerid, COLOR_GREY, "Du kannst dich nicht selber rauswerfen!"); return 1; }
if(IsPlayerInVehicle(playa,test))
{
new PName[MAX_PLAYER_NAME];
GetPlayerName(playerid,PName,sizeof(PName));
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Du hast %s aus dem Auto geworfen!", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Du wurdest von %s aus dem Auto geworfen!", PName);
SendClientMessage(playa, COLOR_LIGHTBLUE, string);
RemovePlayerFromVehicle(playa);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Der Spieler ist nicht in deinem Auto !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Falsche ID!");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Du mußt in einem Farzeug sitzen um den Befehl nutzen zu können ! !");
}
}
return 1;
}
if(strcmp(cmd, "/sex", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJob] == 3)
{
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " Du kannst nur im Auto Sex haben!");
return 1;
}
new Car = GetPlayerVehicleID(playerid);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Benutze: /sex [playerid] [Preis]");
return 1;
}