[Pomoc] /vuci /pusti

Započeo SaneK, Mart 11, 2012, 19:59:25 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

SaneK


Skripta koju koristim: CLRP
Detaljan opis problema: Kad Kucam /Vuci nece da vuce igraca sve normalno uradi a nece, da ga vuce sasobom? Jel bi mi mogao neko pomoc oko toga? Hvala.
Dio skripte: /
Neke slike/video za lakse dobivanje pomoci(neobavezno): /


//////////////////////////////////////////////////////////////////////////////////////////////////////////////
if(strcmp(cmd, "/vuci", 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, "[GRESKA] 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, "   (ODBIJENO) 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, "(ODBIJENO) 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);
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, "/pusti", true) == 0)
{
    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);
}
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 !");
}
}
return 1;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
Poslednja Izmena: Mart 11, 2012, 20:00:56 POSLE PODNE od HuBaBuBa :$

Snich

Ajde probaj ovako:

Pri vrhu skripte:

forward Drag(giveplayerid, playerid);
new DragTimer[MAX_PLAYERS];


Na OnPlayerCommandText:

if (strcmp(cmd, "/vuci", true) == 0)
{
    if(gTeam[playerid] == 2 || IsACop(playerid))
{
  tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp);
  if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Koristenje: /drag [playerid]");
return 1;
}
if(!IsPlayerConnected(giveplayerid))
{
format(string, sizeof(string), "%d nije aktivan igrac.", giveplayerid);
SendClientMessage(playerid,COLOR_GREY, string);
return 1;
}
if(GetDistanceBetweenPlayers(playerid,giveplayerid) > 3)
{
SendClientMessage(playerid, COLOR_GREY, "Previse ste udaljeni od tog igraca!.");
  return 1;
  }
  if(giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_GREY, "Nemozete sami sebe vuci!");
return 1;
}
if(DragTimer[playerid] <= 0)
{
if(IsPlayerConnected(giveplayerid) == 1)
{
  GetPlayerName(giveplayerid, sendername, sizeof(sendername));
  GetPlayerName(playerid, playername, sizeof(playername));
  format(string, sizeof(string), "%s vuce %s", playername, sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
DragTimer[playerid] = SetTimerEx("Drag", 1000, 1, "ii", playerid, giveplayerid);
TogglePlayerControllable(giveplayerid, 0);
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "  Niste Policajac / FBI agent / S.W.A.T !");
}
return 1;
}

if (strcmp(cmd, "/pusti", true) == 0)
{
  tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Koristenje: /pusti [playerid]");
return 1;
}
  if(gTeam[playerid] == 2 || IsACop(playerid))
{
if(DragTimer[playerid] >= 0)
{
  if(PlayerCuffed[giveplayerid] == 1)
{
TogglePlayerControllable(giveplayerid, 0);
}
  GetPlayerName(giveplayerid, sendername, sizeof(sendername));
  GetPlayerName(playerid, playername, sizeof(playername));
  format(string, sizeof(string), "%s je pustio %s", playername, sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
KillTimer(DragTimer[playerid]);
DragTimer[playerid] = 0;
TogglePlayerControllable(giveplayerid, 1);
return 1;
}
    }
else
{
SendClientMessage(playerid, COLOR_GREY, "  Niste Policajac / FBI agent / S.W.A.T !");
}
return 1;
}


Na kraj skripte:

public Drag(giveplayerid, playerid)
{
     new Float:x, Float:y, Float:z;
     GetPlayerPos(giveplayerid, x, y, z);
     SetPlayerPos(playerid, x, y+1, z);
     SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
}

SaneK

Snich Majstore sve EXTRA SUPER radi!!
Samo me zanima jel ce biti problema ako ide Igrac rellog? jel bi mogao jos KillTimer OnPlayerDisconect? Ili?

Jos jednom Hvala ti Snich.. Kralj si!!

Snich

CitatSamo me zanima jel ce biti problema ako ide Igrac rellog? jel bi mogao jos KillTimer OnPlayerDisconect? Ili?
Nek ti stoji trenutno tako, ako budes imao problema, PM me, mada sumnjam da ces imati problema  ;) ...

Problem rijesen. LOCK!