Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: Mat |E| poslato Jun 29, 2015, 13:01:09 POSLE PODNE

Naslov: [Pomoc]Komanda
Poruka od: Mat |E| poslato Jun 29, 2015, 13:01:09 POSLE PODNE
Skripta koju koristim: //
Detaljan opis problema: Pa treba mi CMD /konop,kad sam u helic  i kad idem /konop da me spusti niz konop
Dio skripte:
Neke slike/video za lakse dobivanje pomoci(neobavezno):
Naslov: Odg: [Pomoc]Komanda
Poruka od: Vuzimir poslato Jun 29, 2015, 20:09:47 POSLE PODNE
evo ga: http://pastebin.com/Meih0rbn
Naslov: Odg: [Pomoc]Komanda
Poruka od: Mat |E| poslato Jun 29, 2015, 21:18:05 POSLE PODNE
E da na to sam mislio, samo kako sad da to prebacim u komandu /konop pa da se spusta a ne da moram tipkom aktivirat to, i kad me spusti dole ostane mi ona animacija od spustanja

(http://i.imgur.com/3IzT8Xr.png) (http://imgur.com/3IzT8Xr)
Naslov: Odg: [Pomoc]Komanda
Poruka od: Vuzimir poslato Jun 29, 2015, 21:33:23 POSLE PODNE
Izbaci to sto si ubacio pod OnPlayerKeyStatechange i ubaci ovu komandu:

CMD:konop(playerid,params[])
{
        if(GetPlayerSkin(playerid) == skinid && GetPVarInt(playerid,"roped") == 0 && GetPlayerVehicleSeat(playerid) != 0 && IsPlayerInAnyVehicle(playerid))
        {
                GetPlayerPos(playerid,pl_pos[playerid][0],pl_pos[playerid][1],pl_pos[playerid][2]);
                MapAndreas_FindZ_For2DCoord(pl_pos[playerid][0],pl_pos[playerid][1],pl_pos[playerid][3]);
                pl_pos[playerid][4] = floatsub(pl_pos[playerid][2],pl_pos[playerid][3]);
                if(pl_pos[playerid][4] >= ropelength) return SendClientMessage(playerid,0xAA3333AA,"You are too scared to slide from this height");
                if(pl_pos[playerid][4] <= 2) return RemovePlayerFromVehicle(playerid);
                SetPVarInt(playerid,"roped",1);
                SetPlayerCheckpoint(playerid,pl_pos[playerid][0],pl_pos[playerid][1],floatsub(pl_pos[playerid][3],offsetz),20);
                SetPlayerPos(playerid,pl_pos[playerid][0],pl_pos[playerid][1],floatsub(pl_pos[playerid][2],2));
                SetPlayerVelocity(playerid,0,0,0);
                for(new rep=0;rep!=10;rep++) ApplyAnimation(playerid,"ped","abseil",4.0,0,0,0,1,0);
                for(new cre=0;cre<=pl_pos[playerid][4];cre++)
                {
                    r0pes[playerid][cre] = CreateObject(3004,pl_pos[playerid][0],pl_pos[playerid][1],floatadd(pl_pos[playerid][3],cre),87.640026855469,342.13500976563, 350.07507324219);
                }
                SetTimerEx("syncanim",dur,0,"i",playerid);
        }
        return 1;
}


i da se prekine animacija zamjeni ovo:
public OnPlayerEnterCheckpoint(playerid)
{
    if(GetPVarInt(playerid,"roped") == 1 && GetPlayerSkin(playerid) == skinid)
    {
        SetPVarInt(playerid,"roped",0);
        SetPVarInt(playerid,"chop_id",0);
        ClearAnimations(playerid);
        SetPlayerSkin(playerid, GetPlayerSkin(playerid));
        TogglePlayerControllable(playerid,0);
        TogglePlayerControllable(playerid,1);
        DisablePlayerCheckpoint(playerid);
        for(new destr4=0;destr4<=ropelength;destr4++)
                {
                    DestroyObject(r0pes[playerid][destr4]);
                }
        }
               
        return 1;
}
Naslov: Odg: [Pomoc]Komanda
Poruka od: Mat |E| poslato Jun 29, 2015, 21:46:37 POSLE PODNE
Baca mi warninge


warning 217: loose indentation

public OnPlayerEnterCheckpoint(playerid)
{
    if(GetPVarInt(playerid,"roped") == 1 && GetPlayerSkin(playerid) == skinid)
    {
        SetPVarInt(playerid,"roped",0);
        SetPVarInt(playerid,"chop_id",0);
        ClearAnimations(playerid);
        SetPlayerSkin(playerid, GetPlayerSkin(playerid));
        TogglePlayerControllable(playerid,0);
        TogglePlayerControllable(playerid,1);
        DisablePlayerCheckpoint(playerid);
        for(new destr4=0;destr4<=ropelength;destr4++)
        {
        DestroyObject(r0pes[playerid][destr4]);
         }
        }
return 1;
}


Tu mi error baca   return 1;



i ovaj

123) : warning 203: symbol is never used: "konop"

CMD:konop(playerid, params[])
{
        if(GetPlayerSkin(playerid) == skinid && GetPVarInt(playerid,"roped") == 0 && GetPlayerVehicleSeat(playerid) != 0 && IsPlayerInAnyVehicle(playerid))
        {
                GetPlayerPos(playerid,pl_pos[playerid][0],pl_pos[playerid][1],pl_pos[playerid][2]);
              //  MapAndreas_FindZ_For2DCoord(pl_pos[playerid][0],pl_pos[playerid][1],pl_pos[playerid][3]);
                pl_pos[playerid][4] = floatsub(pl_pos[playerid][2],pl_pos[playerid][3]);
                if(pl_pos[playerid][4] >= ropelength) return SendClientMessage(playerid,0xAA3333AA,"You are too scared to slide from this height");
                if(pl_pos[playerid][4] <= 2) return RemovePlayerFromVehicle(playerid);
                SetPVarInt(playerid,"roped",1);
                SetPlayerCheckpoint(playerid,pl_pos[playerid][0],pl_pos[playerid][1],floatsub(pl_pos[playerid][3],offsetz),20);
                SetPlayerPos(playerid,pl_pos[playerid][0],pl_pos[playerid][1],floatsub(pl_pos[playerid][2],2));
                SetPlayerVelocity(playerid,0,0,0);
                for(new rep=0;rep!=10;rep++) ApplyAnimation(playerid,"ped","abseil",4.0,0,0,0,1,0);
                for(new cre=0;cre<=pl_pos[playerid][4];cre++)
                {
                    r0pes[playerid][cre] = CreateObject(3004,pl_pos[playerid][0],pl_pos[playerid][1],floatadd(pl_pos[playerid][3],cre),87.640026855469,342.13500976563, 350.07507324219);
                }
                SetTimerEx("syncanim",dur,0,"i",playerid);
        }
        return 1;
}
Naslov: Odg: [Pomoc]Komanda
Poruka od: kim3205 poslato Jun 29, 2015, 22:25:30 POSLE PODNE
Definisi konop u pocetku linije
Naslov: Odg: [Pomoc]Komanda
Poruka od: Mat |E| poslato Jun 29, 2015, 22:39:12 POSLE PODNE
Ne moze, kako god stavi pise warning 203: symbol is never used: "konop"
Naslov: Odg: [Pomoc]Komanda
Poruka od: Vuzimir poslato Jun 29, 2015, 22:47:51 POSLE PODNE
Citat: Mat |E| poslato Jun 29, 2015, 22:39:12 POSLE PODNE
Ne moze, kako god stavi pise warning 203: symbol is never used: "konop"

Koji proces komandi ti koristis ZCMD, YCMD ili?
Naslov: Odg: [Pomoc]Komanda
Poruka od: Mat |E| poslato Jun 29, 2015, 22:49:21 POSLE PODNE
Koristim ZCMD, ali pokuso sam to dodat u filterscriptu, a ne direktno u mod
Naslov: Odg: [Pomoc]Komanda
Poruka od: Vuzimir poslato Jun 29, 2015, 22:52:41 POSLE PODNE
Citat: Mat |E| poslato Jun 29, 2015, 22:49:21 POSLE PODNE
Koristim ZCMD, ali pokuso sam to dodat u filterscriptu, a ne direktno u mod

Pa dali u filterskripti imas inkludovan ZCMD?

Jer se ovaj warning jedino javlja kada koristis ZCMD komandu ali nemas inkluda...
Naslov: Odg: [Pomoc]Komanda
Poruka od: Mat |E| poslato Jun 29, 2015, 22:55:27 POSLE PODNE
Pokuso sam i sa strcmp ali mi izbaci ovo

(147) : warning 217: loose indentation

public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp("/konop", cmdtext))
{
        if(GetPlayerSkin(playerid) == skinid && GetPVarInt(playerid,"roped") == 0 && GetPlayerVehicleSeat(playerid) != 0 && IsPlayerInAnyVehicle(playerid))
        {
                GetPlayerPos(playerid,pl_pos[playerid][0],pl_pos[playerid][1],pl_pos[playerid][2]);
              //  MapAndreas_FindZ_For2DCoord(pl_pos[playerid][0],pl_pos[playerid][1],pl_pos[playerid][3]);
                pl_pos[playerid][4] = floatsub(pl_pos[playerid][2],pl_pos[playerid][3]);
                if(pl_pos[playerid][4] >= ropelength) return SendClientMessage(playerid,0xAA3333AA,"You are too scared to slide from this height");
                if(pl_pos[playerid][4] <= 2) return RemovePlayerFromVehicle(playerid);
                SetPVarInt(playerid,"roped",1);
                SetPlayerCheckpoint(playerid,pl_pos[playerid][0],pl_pos[playerid][1],floatsub(pl_pos[playerid][3],offsetz),20);
                SetPlayerPos(playerid,pl_pos[playerid][0],pl_pos[playerid][1],floatsub(pl_pos[playerid][2],2));
                SetPlayerVelocity(playerid,0,0,0);
                for(new rep=0;rep!=10;rep++) ApplyAnimation(playerid,"ped","abseil",4.0,0,0,0,1,0);
                for(new cre=0;cre<=pl_pos[playerid][4];cre++)
                {
                    r0pes[playerid][cre] = CreateObject(3004,pl_pos[playerid][0],pl_pos[playerid][1],floatadd(pl_pos[playerid][3],cre),87.640026855469,342.13500976563, 350.07507324219);
                }
                SetTimerEx("syncanim",dur,0,"i",playerid);
        }
        }
        return 1;
}



taj warning je ovaj return 1;
Naslov: Odg: [Pomoc]Komanda
Poruka od: Vuzimir poslato Jun 29, 2015, 23:20:48 POSLE PODNE
Zanemari taj warning, on je samo da kaze kao da skripta nije uredna, redovi nisu ljepo poredani...
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp("/konop", cmdtext))
{
        if(GetPlayerSkin(playerid) == skinid && GetPVarInt(playerid,"roped") == 0 && GetPlayerVehicleSeat(playerid) != 0 && IsPlayerInAnyVehicle(playerid))
        {
                GetPlayerPos(playerid,pl_pos[playerid][0],pl_pos[playerid][1],pl_pos[playerid][2]);
              //  MapAndreas_FindZ_For2DCoord(pl_pos[playerid][0],pl_pos[playerid][1],pl_pos[playerid][3]);
                pl_pos[playerid][4] = floatsub(pl_pos[playerid][2],pl_pos[playerid][3]);
                if(pl_pos[playerid][4] >= ropelength) return SendClientMessage(playerid,0xAA3333AA,"You are too scared to slide from this height");
                if(pl_pos[playerid][4] <= 2) return RemovePlayerFromVehicle(playerid);
                SetPVarInt(playerid,"roped",1);
                SetPlayerCheckpoint(playerid,pl_pos[playerid][0],pl_pos[playerid][1],floatsub(pl_pos[playerid][3],offsetz),20);
                SetPlayerPos(playerid,pl_pos[playerid][0],pl_pos[playerid][1],floatsub(pl_pos[playerid][2],2));
                SetPlayerVelocity(playerid,0,0,0);
                for(new rep=0;rep!=10;rep++) ApplyAnimation(playerid,"ped","abseil",4.0,0,0,0,1,0);
                for(new cre=0;cre<=pl_pos[playerid][4];cre++)
                {
                    r0pes[playerid][cre] = CreateObject(3004,pl_pos[playerid][0],pl_pos[playerid][1],floatadd(pl_pos[playerid][3],cre),87.640026855469,342.13500976563, 350.07507324219);
                }
                SetTimerEx("syncanim",dur,0,"i",playerid);
        }
}
return 1;
}
Naslov: Odg: [Pomoc]Komanda
Poruka od: Mat |E| poslato Jun 30, 2015, 07:46:26 PRE PODNE
Nema warninga,ali nece mi sada ni jedna komanda na serveru
Naslov: Odg: [Pomoc]Komanda
Poruka od: kim3205 poslato Jun 30, 2015, 09:03:00 PRE PODNE
haha vrati sto si zadnje radio pa ponovo stimaj isto dok izbaci error/warning
Naslov: Odg: [Pomoc]Komanda
Poruka od: Mat |E| poslato Jun 30, 2015, 10:34:03 PRE PODNE
Nema boga
Naslov: Odg: [Pomoc]Komanda
Poruka od: Vuzimir poslato Jun 30, 2015, 10:59:25 PRE PODNE
Citat: Mat |E| poslato Jun 30, 2015, 10:34:03 PRE PODNE
Nema boga

Pa nezz kako bi ti pomogo, radio ti je mod, kad si ubacio ovo ne radi, znaci nesto nisi dobro ubacio...
Naslov: Odg: [Pomoc]Komanda
Poruka od: K ROSE poslato Jun 30, 2015, 11:01:03 PRE PODNE
Ima Boga, probaj ovo

CMD:konop(playerid, params[])
{
if(GetPlayerSkin(playerid) == skinid && GetPVarInt(playerid,"roped") == 0 && GetPlayerVehicleSeat(playerid) != 0 && IsPlayerInAnyVehicle(playerid))
{
  GetPlayerPos(playerid,pl_pos[playerid][0],pl_pos[playerid][1],pl_pos[playerid][2]);
    MapAndreas_FindZ_For2DCoord(pl_pos[playerid][0],pl_pos[playerid][1],pl_pos[playerid][3]);
      pl_pos[playerid][4] = floatsub(pl_pos[playerid][2],pl_pos[playerid][3]);
      if(pl_pos[playerid][4] >= ropelength)
      {
SendClientMessage(playerid,0xAA3333AA,"You are too scared to slide from this height");
return 1;
}
        if(pl_pos[playerid][4] <= 2)
        {
  RemovePlayerFromVehicle(playerid);
}
SetPVarInt(playerid,"roped",1);
  SetPlayerCheckpoint(playerid,pl_pos[playerid][0],pl_pos[playerid][1],floatsub(pl_pos[playerid][3],offsetz),20);
    SetPlayerPos(playerid,pl_pos[playerid][0],pl_pos[playerid][1],floatsub(pl_pos[playerid][2],2));
      SetPlayerVelocity(playerid,0,0,0);
      for(new rep=0;rep!=10;rep++) ApplyAnimation(playerid,"ped","abseil",4.0,0,0,0,1,0);
        for(new cre=0;cre<=pl_pos[playerid][4];cre++)
        {
        r0pes[playerid][cre] = CreateObject(3004,pl_pos[playerid][0],pl_pos[playerid][1],floatadd(pl_pos[playerid][3],cre),87.640026855469,342.13500976563, 350.07507324219);
        }
        SetTimerEx("syncanim",dur,0,"i",playerid);
    }
    return 1;
}
Naslov: Odg: [Pomoc]Komanda
Poruka od: Mat |E| poslato Jun 30, 2015, 11:04:01 PRE PODNE
Sad baca errore
Naslov: Odg: [Pomoc]Komanda
Poruka od: K ROSE poslato Jun 30, 2015, 11:05:48 PRE PODNE
Možda  zbog ovoga
MapAndreas_FindZ_For2DCoord(pl_pos[playerid][0],pl_pos[playerid][1],pl_pos[playerid][3]);

stavi ovako //MapAndreas_FindZ_For2DCoord(pl_pos[playerid][0],pl_pos[playerid][1],pl_pos[playerid][3]);
Naslov: Odg: [Pomoc]Komanda
Poruka od: Mat |E| poslato Jun 30, 2015, 11:07:42 PRE PODNE
156) : error 030: compound statement not closed at the end of file (started at line 126),




public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp("/konop", cmdtext))
{
        if(GetPlayerSkin(playerid) == skinid && GetPVarInt(playerid,"roped") == 0 && GetPlayerVehicleSeat(playerid) != 0 && IsPlayerInAnyVehicle(playerid))
{
  GetPlayerPos(playerid,pl_pos[playerid][0],pl_pos[playerid][1],pl_pos[playerid][2]);
    // MapAndreas_FindZ_For2DCoord(pl_pos[playerid][0],pl_pos[playerid][1],pl_pos[playerid][3]);
      pl_pos[playerid][4] = floatsub(pl_pos[playerid][2],pl_pos[playerid][3]);
      if(pl_pos[playerid][4] >= ropelength)
      {
SendClientMessage(playerid,0xAA3333AA,"You are too scared to slide from this height");
return 1;
}
        if(pl_pos[playerid][4] <= 2)
        {
  RemovePlayerFromVehicle(playerid);
}
SetPVarInt(playerid,"roped",1);
  SetPlayerCheckpoint(playerid,pl_pos[playerid][0],pl_pos[playerid][1],floatsub(pl_pos[playerid][3],offsetz),20);
    SetPlayerPos(playerid,pl_pos[playerid][0],pl_pos[playerid][1],floatsub(pl_pos[playerid][2],2));
      SetPlayerVelocity(playerid,0,0,0);
      for(new rep=0;rep!=10;rep++) ApplyAnimation(playerid,"ped","abseil",4.0,0,0,0,1,0);
        for(new cre=0;cre<=pl_pos[playerid][4];cre++)
        {
        r0pes[playerid][cre] = CreateObject(3004,pl_pos[playerid][0],pl_pos[playerid][1],floatadd(pl_pos[playerid][3],cre),87.640026855469,342.13500976563, 350.07507324219);
        }
        SetTimerEx("syncanim",dur,0,"i",playerid);
    }
    return 1;
}