Hello. I find this command i one gamemode, i put this command i my gamemode but dont work when i type /pull, said you pulling player, but player but I drag a player who does not move, why?
Can someone tell me what the problem.
Thanks in advance.
Sory for bead english...
pawn Код:
if(strcmp(cmd, "/pull", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gTeam[playerid] == 2 || IsACop(playerid))
{
if(KnockedDown[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "Ne mozete vuci kada ste unesvijesceni.");
return 1;
}
if(PlayerTied[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vezani ste!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: /vuci [ID Igraca/Dio Imena]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(gTeam[giveplayerid] == 2 || IsACop(giveplayerid))
{
SendClientMessage(playerid, COLOR_GREY, " Ne mozete vuci Policajca!");
return 1;
}
if(PlayerCuffed[giveplayerid] != 2)
{
SendClientMessage(playerid, COLOR_GREY, " Igracu nisu stavljene lisice!");
return 1;
}
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Ne mozete vuci sami sebe!"); return 1; }
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s vas vuce.", sendername);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Vucete %s-a.", giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* %s vuce %s-a.", sendername ,giveplayer);
SetPVarInt(playerid,"VuceIgraca",giveplayer);//Postavio na varijablu VuceIgraca ID igraca kojeg vuce
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Taj igrac nije blizu vas !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Igrac je offline !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Niste Policajac / FBI / SWAT !");
}
}
return 1;
}
if(strcmp(cmd, "/pulloff", true) == 0)// This command is to let players dragged
{
if(IsPlayerConnected(playerid))
{
if(gTeam[playerid] == 2)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: /pusti [ID Igraca/Dio Imena]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Ne mozete sebe pustiti!"); return 1; }
if(PlayerCuffed[giveplayerid])
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s vas je pustio.", sendername);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Pustili ste %s-a.", giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
TogglePlayerControllable(giveplayerid, 0);
SetPVarInt(playerid,"VuceIgraca",999);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Tome igracu nisu stavljene lisice !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Taj igrac nije blizu vas !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Taj igrac je offline !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Niste Policajac / FBI / SWAT !");
}
}