Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: Mat |E| poslato Jun 28, 2015, 14:43:55 POSLE PODNE

Naslov: [Pomoc] Komanda
Poruka od: Mat |E| poslato Jun 28, 2015, 14:43:55 POSLE PODNE
Skripta koju koristim: //
Detaljan opis problema: Imam cmd /lisice i /skinilisice u STRCMP je,E sad ocu u ZCMD da kuca /lisice [Id igraca] da mu stavi lisice,a isto tako kad ponovo kuca /lisice i isti taj ID igraca da mu skine lisice
Dio skripte:
//----------------------------------[Lisice]----------------------------------//
if(strcmp(cmd, "/cuff", true) == 0 || strcmp(cmd, "/lisice", true) == 0)
{
    if(IgracLogovan[playerid] == 1)
    {
if(IsACop(playerid))
{
if(KnockedDown[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "{F3FF02}Ne mozete zamahnuti kada ste vec oboreni.");
return 1;
}
if(PlayerTied[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " {F3FF02}Vezani ste!");
return 1;
}
    tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_NICERED, " {00C0FF}/lisice [ID Igraca]");
return 1;
}
giveplayerid = ReturnUser(tmp);
    if(IgracLogovan[giveplayerid] == 1)
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
        if(IsACop(giveplayerid))
        {
            SendClientMessage(playerid, COLOR_GREY, "{F3FF02}Ne mozete staviti lisice Policajcu!");
        return 1;
        }
    if(PlayerCuffed[giveplayerid] > 1)
    {
        SendClientMessage(playerid, COLOR_GREY, "{F3FF02}Igracu su vec stavljene lisice !");
        return 1;
    }
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "{FFFFFF}[YUB]: {F3FF02}Ne mozete staviti lisice sebi!"); return 1; }
    {
        imeigraca(giveplayerid, giveplayer);
imeigraca(playerid, sendername);
        format(string, sizeof(string), "{C9FFAB}%s vam je stavio lisice.", sendername);
SendClientMessage(giveplayerid, SIVA, string);
format(string, sizeof(string), "{C9FFAB}Stavili ste lisice %s.", giveplayer);
SendClientMessage(playerid, SIVA, string);
format(string, sizeof(string), "Policajac %s stavlja lisice osobi %s...", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(giveplayerid, "~r~Stavljene su vam lisice", 2500, 3);
TogglePlayerControllable(giveplayerid, 0);
PlayerCuffed[giveplayerid] = 1;
SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_CUFFED);
PlayerCuffedTime[giveplayerid] = 50000000;
    }

}
else
{
    SendClientMessage(playerid, COLOR_GREY, "{F3FF02}Igrac nije u vasoj blizini!");
    return 1;
}
}
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "{F3FF02}Igrac sa tim ID-om se ne nalazi na serveru!");
    return 1;
}
}
}
return 1;
}



if(strcmp(cmd, "/uncuff", true) == 0 || strcmp(cmd, "/skinilisice", true) == 0)
{
    if(IgracLogovan[playerid] == 1)
    {
if(gTeam[playerid] == 2)
{
    tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_NICERED, "{00C0FF}/skinilisice [ID Igraca]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IgracLogovan[giveplayerid] == 1)
{
if(giveplayerid != INVALID_PLAYER_ID)
{
    if (ProxDetectorS(8.0, playerid, giveplayerid))
{
    if(giveplayerid == playerid) { return 1; }
if(PlayerCuffed[giveplayerid])
{
    imeigraca(giveplayerid, giveplayer);
imeigraca(playerid, sendername);
    format(string, sizeof(string), "{C9FFAB}%s vam je skinuo lisice.", sendername);
SendClientMessage(giveplayerid, SIVA, string);
format(string, sizeof(string), "{C9FFAB}Skinuli ste lisice %s.", giveplayer);
SendClientMessage(playerid, SIVA, string);
format(string, sizeof(string), "Policajac %s skida lisice osobi %s...", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(giveplayerid, "~g~Skinute su vam lisice", 2500, 3);
TogglePlayerControllable(giveplayerid, 1);
PlayerCuffed[giveplayerid] = 0;
ClearAnimations(giveplayerid);
PlayerCuffedTime[giveplayerid] = 0;
ClearAnimations(playerid);
                SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
                TogglePlayerControllable(playerid,1);

}
else
{
    SendClientMessage(playerid, COLOR_GREY, "{F3FF02}Tom igracu nisu stavljene lisice !");
    return 1;
}
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "{F3FF02}Igrac nije u vasoj blizini!");
    return 1;
}
}
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "{F3FF02}Igrac sa tim ID-om se ne nalazi na serveru!");
    return 1;
}
}
}//not connected
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):
Naslov: Odg: [Pomoc] Komanda
Poruka od: K ROSE poslato Jun 28, 2015, 17:42:06 POSLE PODNE
CMD:lisice(playerid, params[])
{
    new sendername[MAX_PLAYER_NAME],giveplayerid,giveplayer[MAX_PLAYER_NAME],string[128];
    if(sscanf(params,"u",giveplayerid)) return SCM(playerid, COLOR_GRAD2, "Koriscenje: /lisice [ID Igraca/Dio Imena]");
{
    if(giveplayerid != INVALID_PLAYER_ID)
{
    if(PlayerTied[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " {F3FF02}Vezani ste!");
return 1;
}
    if(IsACop(giveplayerid))
      {
        SendClientMessage(playerid, COLOR_GREY, "{F3FF02}Ne mozete staviti lisice Policajcu!");
        return 1;
        }
        if(PlayerCuffed[giveplayerid] > 1)
    {
      SendClientMessage(playerid, COLOR_GREY, "{F3FF02}Igracu su vec stavljene lisice !");
        return 1;
    }
    if(giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_GREY, "{FFFFFF}[YUB]: {F3FF02}Ne mozete staviti lisice sebi!");
return 1;
    }
    if(ProxDetectorS(8.0, playerid, giveplayerid))
{
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                            GetPlayerName(playerid, sername, sizeof(sendername));
    format(string, sizeof(string), "{C9FFAB}%s vam je stavio lisice.", sendername);
SendClientMessage(giveplayerid, SIVA, string);
format(string, sizeof(string), "{C9FFAB}Stavili ste lisice %s.", giveplayer);
SendClientMessage(playerid, SIVA, string);
format(string, sizeof(string), "Policajac %s stavlja lisice osobi %s...", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(giveplayerid, "~r~Stavljene su vam lisice", 2500, 3);
TogglePlayerControllable(giveplayerid, 0);
PlayerCuffed[giveplayerid] = 1;
SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_CUFFED);
PlayerCuffedTime[giveplayerid] = 50000000;
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "{F3FF02}Igrac nije u vasoj blizini!");
    return 1;
}
}
else
{
  SendClientMessage(playerid, COLOR_GREY, "{F3FF02}Igrac sa tim ID-om se ne nalazi na serveru!");
    return 1;
}
}
return 1;
}
Naslov: Odg: [Pomoc] Komanda
Poruka od: Max_Armadilo poslato Jun 28, 2015, 18:27:00 POSLE PODNE
.....
Naslov: Odg: [Pomoc] Komanda
Poruka od: Mat |E| poslato Jun 28, 2015, 19:17:26 POSLE PODNE
Radi, ali kako da kad sada ponovo ukucam /lisice ID igraca da mu se skinu lisice.. Da ne bi moro pravit novu komandu /skinilisice
Naslov: Odg: [Pomoc] Komanda
Poruka od: K ROSE poslato Jun 28, 2015, 21:30:32 POSLE PODNE
CMD:lisice(playerid, params[])
{
    new sendername[MAX_PLAYER_NAME],giveplayerid,giveplayer[MAX_PLAYER_NAME],string[128],lisiceid;
    if(sscanf(params,"ud",giveplayerid,lisiceid)) return SCM(playerid, COLOR_GRAD2, "Koriscenje: /lisice [ID Igraca/Dio Imena] [0 ili 1]");
    if(lisiceid < 0 || lisiceid > 1) { SendClientMessage(playerid, COLOR_GREY, "Pogresan ID!"); return 1; }
{
    if(giveplayerid != INVALID_PLAYER_ID)
{
    if(PlayerTied[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " {F3FF02}Vezani ste!");
return 1;
}
    if(IsACop(giveplayerid))
      {
        SendClientMessage(playerid, COLOR_GREY, "{F3FF02}Ne mozete staviti lisice Policajcu!");
        return 1;
        }
        if(PlayerCuffed[giveplayerid] > 1)
    {
      SendClientMessage(playerid, COLOR_GREY, "{F3FF02}Igracu su vec stavljene lisice !");
        return 1;
    }
    if(giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_GREY, "{FFFFFF}[YUB]: {F3FF02}Ne mozete staviti lisice sebi!");
return 1;
    }
    if(lisiceid == 0)
    {
    if(ProxDetectorS(8.0, playerid, giveplayerid))
{
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
        GetPlayerName(playerid, sername, sizeof(sendername));
    format(string, sizeof(string), "{C9FFAB}%s vam je skinuo lisice.", sendername);
SendClientMessage(giveplayerid, SIVA, string);
format(string, sizeof(string), "{C9FFAB}Skinuli ste lisice %s.", giveplayer);
SendClientMessage(playerid, SIVA, string);
format(string, sizeof(string), "Policajac %s skida lisice osobi %s...", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(giveplayerid, "~r~Skinute su vam lisice", 2500, 3);
TogglePlayerControllable(giveplayerid, 1);
PlayerCuffed[giveplayerid] = 0;
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
PlayerCuffedTime[giveplayerid] = 0;
return 1;
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "{F3FF02}Igrac nije u vasoj blizini!");
    return 1;
}
}
else if(lisiceid == 1)
{
    if(ProxDetectorS(8.0, playerid, giveplayerid))
{
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
        GetPlayerName(playerid, sername, sizeof(sendername));
    format(string, sizeof(string), "{C9FFAB}%s vam je stavio lisice.", sendername);
SendClientMessage(giveplayerid, SIVA, string);
format(string, sizeof(string), "{C9FFAB}Stavili ste lisice %s.", giveplayer);
SendClientMessage(playerid, SIVA, string);
format(string, sizeof(string), "Policajac %s stavlja lisice osobi %s...", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(giveplayerid, "~r~Stavljene su vam lisice", 2500, 3);
TogglePlayerControllable(giveplayerid, 0);
PlayerCuffed[giveplayerid] = 1;
SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_CUFFED);
PlayerCuffedTime[giveplayerid] = 50000000;
return 1;
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "{F3FF02}Igrac nije u vasoj blizini!");
    return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "{F3FF02}Igrac sa tim ID-om se ne nalazi na serveru!");
return 1;
}
}
return 1;
}
Naslov: Odg: [Pomoc] Komanda
Poruka od: Mat |E| poslato Jun 29, 2015, 13:42:39 POSLE PODNE
Rijeseno lock
Naslov: Odg: [Pomoc] Komanda
Poruka od: Vuzimir poslato Jun 29, 2015, 19:45:39 POSLE PODNE
Lock na zahtjev autora teme!