Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: DaxMunze poslato April 19, 2012, 17:59:11 POSLE PODNE

Naslov: [Pomoc] Komanda /vuci
Poruka od: DaxMunze poslato April 19, 2012, 17:59:11 POSLE PODNE
Skripta koju koristim: Ne znam
Detaljan opis problema: Nasao sam negde komandu vuci i ubacio sam je u svoj mod ali ja kad kucam /vuci pise na chatu da vucem tog igraca ali on se nepomera, video sam dosta ovakvih tema ali nigde niko nije napisao kako da resim pa ako neko sad zna nek mi kaze ako mu nije problem.
Dio skripte:    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 na podu.");
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/Deo Imena]");
return 1;
}
giveplayerid = ReturnUser(tmp);
    if(IsPlayerConnected(giveplayerid))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
        if(gTeam[giveplayerid] == 2 || IsACop(giveplayerid))
        {
            SendClientMessage(playerid, COLOR_GREY, "   [GRESKA] Ne mozete vuci Policajca!");
        return 1;
        }
        if(PlayerCuffed[giveplayerid] != 1)
        {
            SendClientMessage(playerid, COLOR_GREY, "   Igracu nisu stavljene lisice!");
        return 1;
        }
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "[GRESKA] 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;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno): msm da sam dobro objasnio netreba slika.
Naslov: Odg: [Pomoc] Komanda /vuci
Poruka od: ANDRIJAâ„¢ poslato April 19, 2012, 19:08:16 POSLE PODNE
Care evo ti moja komanda pa prepravi sebi ako oces moja radi meni mislim  ;D  :D  ;)

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, "   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);
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 / Vojska !");
}
}
return 1;
}
Naslov: Odg: [Pomoc] Komanda /vuci
Poruka od: DaxMunze poslato April 19, 2012, 19:36:40 POSLE PODNE
Nema razlike izmedju komandi :)
Naslov: Odg: [Pomoc] Komanda /vuci
Poruka od: ANDRIJAâ„¢ poslato April 19, 2012, 19:44:30 POSLE PODNE
omg a kod mene radi  ??? ???
Naslov: Odg: [Pomoc] Komanda /vuci
Poruka od: DaxMunze poslato April 19, 2012, 20:05:05 POSLE PODNE
Jel ima nesto sto pre toga trebam da dodam.
Naslov: Odg: [Pomoc] Komanda /vuci
Poruka od: Blaeks poslato April 20, 2012, 00:21:04 PRE PODNE
Stavi ovo na vrh i javi forward Drag(giveplayerid, playerid);
new DragTimer[MAX_PLAYERS];
?

I probaj ovakvu komandu 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, "KORISCENJE: /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;
}
Naslov: Odg: [Pomoc] Komanda /vuci
Poruka od: DaxMunze poslato April 20, 2012, 14:16:07 POSLE PODNE
ma jok, neradi pise da ga vuce ali to neradi igrac stoji u mestu.
Naslov: Odg: [Pomoc] Komanda /vuci
Poruka od: [BR]Maki187 poslato April 20, 2012, 14:18:43 POSLE PODNE
Citat: Adnan Lord poslato April 19, 2012, 19:44:30 POSLE PODNE
omg a kod mene radi  ??? ???

Nevidim na kojoj osnovi ti radi, jer sve sto ta komanda radi, jeste da ispisuje text, nigde nema pokrenutog tajmera, preko kog bi se vuko igrac...

Citat: DaxMunze poslato April 20, 2012, 14:16:07 POSLE PODNE
ma jok, neradi pise da ga vuce ali to neradi igrac stoji u mestu.

Kao sto sam napomenuo, fali ti gore tajmer, u ko mse izvrsava sva radnja... napravis varijablu koja igracu se postavi na id onog kog vuce, uradis proveru da ako varijabla niej na npr 9999, da mu poziciju stavlja na onu poziciju na kojoj se nalazi igrac koj vuce..

Naslov: Odg: [Pomoc] Komanda /vuci
Poruka od: DaxMunze poslato April 20, 2012, 14:22:37 POSLE PODNE
Mozes malo bolje da mi objasnis :) Novi sam u skriptanju znaci samo da mi napises gde sta ide :)
Naslov: Odg: [Pomoc] Komanda /vuci
Poruka od: MEMOREX™️ poslato April 20, 2012, 14:24:49 POSLE PODNE
Probaj ovako vuce igraca do tebe...

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, "   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);
ProxDetector(30.0, playerid, string,        COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                                                new Float:plocx,Float:plocy,Float:plocz;
                                                                GetPlayerPos(playerid, plocx, plocy, plocz);
                                                                SetPlayerPos(giveplayerid,plocx,plocy+1, plocz);
    }

}
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 / Vojska !");
}
}
return 1;
}

Naslov: Odg: [Pomoc] Komanda /vuci
Poruka od: DaxMunze poslato April 20, 2012, 14:36:42 POSLE PODNE
Nevuce igraca samo pise da ga vuce, jel trebam nesto gore da dodam neki forward i sl.
Naslov: Odg: [Pomoc] Komanda /vuci
Poruka od: Snich poslato April 20, 2012, 14:43:34 POSLE PODNE
Ja sam vec negdje postavio ove komande /vuci i /pusti koja radi, pokusaj da nadjes pomoci trazilice ...
Naslov: Odg: [Pomoc] Komanda /vuci
Poruka od: DaxMunze poslato April 20, 2012, 14:47:04 POSLE PODNE
Trazio sam ali svuda isto pise :) Ja nisam nasao ni jednu da radi.
Ako ti mozes posto verovatno znas kako se zove tema.
Naslov: Odg: [Pomoc] Komanda /vuci
Poruka od: ...Nikola... poslato April 20, 2012, 14:52:08 POSLE PODNE
http://balkan-samp.com/forum/index.php?topic=40217.msg301691#msg301691
Evo ti link
Naslov: Odg: [Pomoc] Komanda /vuci
Poruka od: DaxMunze poslato April 20, 2012, 15:22:44 POSLE PODNE
Radi hvala svima :)
Naslov: Odg: [Pomoc] Komanda /vuci
Poruka od: Joey_ poslato April 20, 2012, 16:12:04 POSLE PODNE
Riješeno - LOCK