Hey Leute
wollte mal fragen warum es so ist, dass wenn ich /freefromcar eingebe zwar der ganze Befehl kommt aber wenn ich eingebe /freefromcar 1 0 dann kommt nix nicht mal SendClientMessage
Finde den Fehler nicht
Code:
if(strcmp(cmd, "/freefromcar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInFrac(playerid, 21))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "Befehl: /freefromcar [playerid] [Sitz: 0 = hinten links, 1 = hinten rechts]");
return 1;
}
giveplayerid = ReturnUser(tmp);
//if(!IsAWheelman(giveplayerid)) return SendClientMessage(playerid, COLOR_GRAD2, "Dieser Spieler ist kein Gang-mitglied.");
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != playerid)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "Befehl: /freefromcar [playerid] [Sitz: 0 = hinten links, 1 = hinten rechts]");
return 1;
}
new sit = strval(tmp);
if(sit < 0 || sit > 1)
{
SendClientMessage(playerid, COLOR_GREY, "Wähle den Sitzplatz nicht unter 0 oder über 1!");
return 1;
}
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
SendClientMessage(playerid, COLOR_GREY, "Du bist nicht der Fahrer dieses Fahrzeuges!");
return 1;
}
if(GetDistanceBetweenPlayers(playerid, giveplayerid) < 10)
{
new member = 0;
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pMember] == PlayerInfo[playerid][pMember] || PlayerInfo[i][pLeader] == PlayerInfo[playerid][pMember]
|| PlayerInfo[i][pLeader] == PlayerInfo[playerid][pLeader])
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER || GetPlayerState(i) == PLAYER_STATE_PASSENGER)
{
member ++;
}
}
}
if(member >= 2)
{
if(GetDistanceBetweenPlayers(playerid, giveplayerid) < 10)
{
if(IsPlayerInAnyVehicle(giveplayerid))
{
new car = GetPlayerVehicleID(playerid);
if(sit == 0)
{
SetTimerEx("FreeFromCar1", 10000, 0, "i", playerid);
SendClientMessage(playerid, HBLAU, "Bleib 10 Sekunden an ihm dran um ihn aus dem Car zu ziehen!");
format(string, sizeof(string), "** Ein Wheelman versucht %s aus dem Auto zu ziehen!", giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else if(sit == 1)
{
RemovePlayerFromVehicle(giveplayerid);
new Float:X,Float:Y,Float:Z;
GetPlayerPos(giveplayerid,X,Y,Z);
SetPlayerPos(giveplayerid,X,Y,Z+5);
format(string,sizeof(string),"* Du hast %s erfolgreich auf dem Sitzplatz 1 gezogen !",giveplayer);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
PutPlayerInVehicle(giveplayerid, car, 3);
UnFreezePlayer(giveplayerid);
PlayerTied[giveplayerid] = 0;
format(string, sizeof(string), "** Wheelman %s hat %s in sein Fahrzeug gezogen.", sendername,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
// format(string, sizeof(string), "ACHTUNG: %s wurde von %s gekidnapped.",giveplayer,sendername);
for(new g=0;g<MAX_PLAYERS; g++)
{
if(IsPlayerInFrac(playerid, 21))
{
// SendClientMessage(g, COLOR_GRAD2, string);
}
}
}
}
}
}
}
}
}
}
return 1;
}