if(strcmp(cmd, "/drag", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /drag [Playerid/Name]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(gTeam[giveplayerid] == 2 || IsACop(giveplayerid))
{
SendClientMessage(playerid, COLOR_GREY, " Du kannst keine Cops schleifen !");
return 1;
}
if(DragOff[giveplayerid] < 0)
{
SendClientMessage(playerid, COLOR_GREY, " Spieler wird bereits geschliefen!");
return 1;
}
if (ProxDetectorS(3.0, playerid, giveplayerid))
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Du wirst von %s geschliffen, solange bis er dich loslässt.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Du schleifst %s, bis du damit aufhörst /stopdrag.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s fängt an %s hintersicherherzuschleifen.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
TogglePlayerControllable(giveplayerid, 0);
DragOff[giveplayerid] = playerid;
dragtimer[giveplayerid] = SetTimerEx("Drag", 800, true, "i", giveplayerid, 1);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Der Spieler ist nicht in deiner Nähe !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Du kannst dich nicht selber schleifen!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Der Spieler ist Offline !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Du bist kein Cop / FBI / National Guard!");
}
}
return 1;
}
if(strcmp(cmd, "/stopdrag", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /stopdrag [Playerid/Name]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if (ProxDetectorS(3.0, playerid, giveplayerid))
{
if(giveplayerid == playerid)
{
if(DragOff[giveplayerid] > 0)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s hört auf dich hinterzuschleifen.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Du hast aufgehört %s hinter dir herzuschleifen.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
TogglePlayerControllable(giveplayerid, 1);
DragOff[giveplayerid] = 1;
KillTimer(dragtimer[giveplayerid]);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Dieser Spieler wird nicht geschliffen !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Dieser Spieler ist nicht in deiner Nähe !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Du kannst nicht selber aufhören dich zu schleifen!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Der Spieler ist Offline !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Du bist kein Cop !");
}
}
return 1;
}
probiere es mal so
und
new dragtimer;
mit
new dragtimer[MAX_PLAYERS];
ersetzen