Hey Leute
habe folgenden Befehl:
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)
{
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 0 gezogen !",giveplayer);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
PutPlayerInVehicle(giveplayerid, car, 2);
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);
UnFreezePlayer(giveplayerid);
PlayerTied[giveplayerid] = 0;
}
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;
}
Wie krieg ich's hin dass dort ein Timer kommt was von 10 auf 1 runterzählt und dann wird er befreit?