[Pomoc]Oko /ticket

Započeo Nitr0, Decembar 30, 2013, 14:39:57 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:BM
Detaljan opis problema:Kako da napravim da mi bude /ticket  [ID/Dio Imena] [razlog] a ne ovako  /ticket  [ID/Dio Imena] [cena] [razlog]
Dio skripte: if(strcmp(cmd, "/ticket", true) == 0 || strcmp(cmd, "/kazna", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(gTeam[playerid] != 2)
{
    SendClientMessage(playerid, COLOR_GREY, "   Niste policajac!");
    return 1;
}
        if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
{
    SendClientMessage(playerid, COLOR_GREY, "   Niste na Duznosti!");
    return 1;
}
    tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{80FFFF}BM:RP | {FFFFFF} /kazna [ID Igraca/Dio Imena] [Cena] [razlog]");
return 1;
}
giveplayerid = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{80FFFF}BM:RP | {FFFFFF} /ticket [ID Igraca/Dio Imena] [Cena] [razlog]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 150) { SendClientMessage(playerid, COLOR_GREY, "   Cena kazne ne moze biti ispod 1 ni preko 150 !"); return 1; }
if(IsPlayerConnected(giveplayerid))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
        if (ProxDetectorS(8.0, playerid, giveplayerid))
{
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "{80FFFF}BM:RP | {FFFFFF} /ticket [ID Igraca/Dio Imena] [Cena] [razlog]");
return 1;
}
if (GetPlayerMoney(giveplayerid) < moneys)
{
SendClientMessage(playerid, COLOR_WHITE, "* Taj igrac nema dovoljno novca da plati kaznu.");
return 1;
}
format(string, sizeof(string), "* Napisali ste %s-u kaznu od $%d, razlog: %s", giveplayer, moneys, (result));
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Policajac %s vam je napisao kaznu od $%d, razlog: %s", sendername, moneys, (result));
SendClientMessage(giveplayerid, COLOR_WHITE, string);
SendClientMessage(giveplayerid, COLOR_WHITE, "* Kucajte /accept ticket, da je prihvatite.");
SendClientMessage(giveplayerid, COLOR_WHITE, "* Ako ne prihvatite kaznu, ici cete u zatvor!");
TicketOffer[giveplayerid] = playerid;
TicketMoney[giveplayerid] = moneys;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "   Taj igrac nije blizu vas !");
return 1;
}
}
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "   Igrac je offline !");
    return 1;
}
}
return 1;
}
  return 1;//SendClientMessage(playerid,  COLOR_LIGHTRED, "{C77D87}[GRESKA]: {C0C0C0}Komanda koju ste upisali ne postoji kucajte {C77D87}/help {C0C0C0}da vidite listu komandi!");
}


Neke slike/video za lakse dobivanje pomoci(neobavezno):


if(strcmp(cmd, "/ticket", true) == 0 || strcmp(cmd, "/kazna", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(gTeam[playerid] != 2)
{
    SendClientMessage(playerid, COLOR_GREY, "   Niste policajac!");
    return 1;
}
        if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
{
    SendClientMessage(playerid, COLOR_GREY, "   Niste na Duznosti!");
    return 1;
}
    tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{80FFFF}BM:RP | {FFFFFF} /kazna [ID Igraca/Dio Imena] [razlog]");
return 1;
}
giveplayerid = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{80FFFF}BM:RP | {FFFFFF} /ticket [ID Igraca/Dio Imena] [razlog]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 150) { SendClientMessage(playerid, COLOR_GREY, "   Cena kazne ne moze biti ispod 1 ni preko 150 !"); return 1; }
if(IsPlayerConnected(giveplayerid))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
        if (ProxDetectorS(8.0, playerid, giveplayerid))
{
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "{80FFFF}BM:RP | {FFFFFF} /ticket [ID Igraca/Dio Imena] [Cena] [razlog]");
return 1;
}
if (GetPlayerMoney(giveplayerid) < moneys)
{
SendClientMessage(playerid, COLOR_WHITE, "* Taj igrac nema dovoljno novca da plati kaznu.");
return 1;
}
format(string, sizeof(string), "* Napisali ste %s-u, razlog: %s", giveplayer, (result));
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Policajac %s vam je napisao kaznu, razlog: %s", sendername, (result));
SendClientMessage(giveplayerid, COLOR_WHITE, string);
SendClientMessage(giveplayerid, COLOR_WHITE, "* Kucajte /accept ticket, da je prihvatite.");
SendClientMessage(giveplayerid, COLOR_WHITE, "* Ako ne prihvatite kaznu, ici cete u zatvor!");
TicketOffer[giveplayerid] = playerid;
TicketMoney[giveplayerid] = moneys;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "   Taj igrac nije blizu vas !");
return 1;
}
}
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "   Igrac je offline !");
    return 1;
}
}
return 1;
}
  return 1;//SendClientMessage(playerid,  COLOR_LIGHTRED, "{C77D87}[GRESKA]: {C0C0C0}Komanda koju ste upisali ne postoji kucajte {C77D87}/help {C0C0C0}da vidite listu komandi!");
}

Izvoli :D