Hallo meine Freunde, ich habe da ein Problem:
Ich wollte bei der Fraktion Wheelman so einrichten, das die Wheelmans per CMD Einen User aus einem Anderen Veh in ihr eigenes Ziehen können.
Ich habe da einiges versucht, aber nix so richtig klappt. Der zu befreiende wird nun aus dem Auto genommen, aber nicht in das Veh des Wheelmens gemoved.
Wo ist mein Denkfehler? Hier Codes:
Code
public rauswerfen1(playerid)
{
new car = GetPlayerVehicleID(playerid);
PutPlayerInVehicle(playerid, car, 1);
return 1;
}
public rauswerfen2(playerid)
{
new car = GetPlayerVehicleID(playerid);
PutPlayerInVehicle(playerid, car, 3);
return 1;
}
Alles anzeigen
Code
if(strcmp(cmd, "/reinziehen", true) == 0)
{
if(IsPlayerInFrac(playerid, 21))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "__________________ Reinziehen __________________");
SendClientMessage(playerid, COLOR_GREY, "Befehl: /reinziehen [playerid] [0/1]");
SendClientMessage(playerid, COLOR_GREY, "Info: 0 = Vorne rechts, 1 = Hinten rechts");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != playerid)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "Befehl: /reinziehen [Spieler ID] [0/1]");
SendClientMessage(playerid, COLOR_GREY, "Info: 0 = Vorne rechts, 1 = Hinten rechts!");
return 1;
}
new sit = strval(tmp);
if(sit < 0 || sit > 1) { SendClientMessage(playerid, COLOR_GREY, "Es gibt nur die Sitzplätze 0 und 1!"); return 1; }
// if(IsPlayerInAnyVehicle(giveplayerid)) { RemovePlayerFromVehicle(giveplayerid);}
if(GetDistanceBetweenPlayers(playerid, giveplayerid) < 8)
{
// new car = GetPlayerVehicleID(playerid);
if(sit == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Du wurdest von %s ins Car gezogen, bald bist du in Sicherheit!", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s nimmt dir 5000$ ab!", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
// PutPlayerInVehicle(giveplayerid, car, 1);
SetTimerEx("rauswerfen2",500,0,"i",giveplayerid);
// FreezePlayer(giveplayerid);
PlayerCuffed[giveplayerid] = 0;
PlayerInfo[giveplayerid][pMauled] = 0;
PlayerTied[giveplayerid] = 0;
SetCameraBehindPlayer(giveplayerid);
BlindFold[giveplayerid] = 0;
format(string, sizeof(string), "* %s hat %s ins Auto gezogen!", sendername ,giveplayer);
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_PURPLE, "Du hast ihn/sie, nun ab zu einer sicheren Stelle!");
GivePlayerMoney(playerid, 5000);
GivePlayerMoney(giveplayerid, -5000);
}
else if(sit == 1)
{
RemovePlayerFromVehicle(giveplayerid);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Du wurdest von %s ins Car gezogen,bald bist du in Sicherheit!", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s nimmt dir 5000$ ab!", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
// PutPlayerInVehicle(giveplayerid, car, 3);
SetTimerEx("rauswerfen2",500,0,"i",giveplayerid);
// FreezePlayer(giveplayerid);
PlayerCuffed[giveplayerid] = 0;
PlayerInfo[giveplayerid][pMauled] = 0;
PlayerTied[giveplayerid] = 0;
SetCameraBehindPlayer(giveplayerid);
BlindFold[giveplayerid] = 0;
format(string, sizeof(string), "* %s hat %s ins Auto gezogen!", sendername ,giveplayer);
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_PURPLE, "Du hast ihn/sie, nun ab zu einer sicheren Stelle!");
GivePlayerMoney(playerid, 5000);
GivePlayerMoney(giveplayerid, -5000);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Der Spieler ist nicht in deiner Nähe!");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Spieler ist nicht online!");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Du bist kein Mitglied der Wheelmen Agency!");
}
return 1;
}
Alles anzeigen