( Pomoc ) /prihvati popravku...

Započeo Alan ã‹¡, Jul 03, 2013, 20:38:52 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta : SL:RP

Ovako imam problem sa komandom /prihvati popravku,znaci mehanicar sam i /popravka i ponudim igracu ponudu i dodje mu SCM, ali kada kucam /prihvati popravku nista se desava...

Komanda /poparavka :

YCMD:popravka(playerid, params[], help)
{
     new playa,money,giveplayer[MAX_PLAYER_NAME],string[256];
     if(PlayerInfo[playerid][pPosao] != POSAO_MEHANICAR) return SCM(playerid, BELA, "{FF0000}[SLClient!]{BFC0C2} Niste zaposleni kao mehanicar!");
     if(StavioOpremu[playerid] == 0) return SCM(playerid, BELA, "{BFC0C2}Nisi u opremi za posao.{FFFFFF} (/mehanicaroprema)");
else if(sscanf(params,"ui", playa,money)) return SCM(playerid, BELA, "Koristi: /popravka [ ID Igraca ] [ Cena popravka ]");
else if(money < 10 || money > 1000) { SCM(playerid, CRVENA,"{E0981B}SL:RP: {FFFFFF}Cena ne moze biti manja od 10 ili veca od 1000."); return 1; }
     else if(playa != INVALID_PLAYER_ID)
     {
         if(ProxDetectorS(8.0, playerid, playa)&& IsPlayerInAnyVehicle(playa))
{
new sendername[256];
         if(playa == playerid) { SCM(playerid, CRVENA, "{E0981B}SL:RP: {FFFFFF}Ne mozete popraviti auto sam sebi."); return 1; }
           GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
     format(string, sizeof(string), "Ponudili ste %s popravak auta za $%d.",giveplayer,money);
  SCM(playerid, PLAVA, string);
format(string, sizeof(string), "Mehanicar %s vam je ponudio popravak po cijeni od $%d. (/prihvati popravku)",sendername,money);
SCM(playa, PLAVA, string);
RepairOffer[playa] = playerid;
RepairPrice[playa] = money;
}
else
{
             SCM(playerid, CRVENA, "{E0981B}SL:RP: {FFFFFF}Taj igrac nije blizu vas/nije u autu.");
  }
     }
return 1;
}



Komanda /prihvati popravku

YCMD:prihvati(playerid, params[], help)
{
    new param1[4];
if (sscanf(params, "s[4] ", param1)) {
        SendClientMessage(playerid, BELA, "|__________________ Opcije __________________|");
SendClientMessage(playerid, BELA, "  KORISCENJE: /prihvati [Opcija]");
SendClientMessage(playerid, BELA, "Dostupna Imena: Popravku");
SendClientMessage(playerid, BELA, "|____________________________________________|");
return 1;
    }
if(strcmp(param1,"popravku",true) == 0)
{
    if(RepairOffer[playerid] < 999)
        {
            if(GetPlayerMoney(playerid) > RepairPrice[playerid])
        {
            if(IsPlayerInAnyVehicle(playerid))
    {
new sendername[254];
        new RepairCar[MAX_PLAYERS];
new giveplayer[MAX_PLAYER_NAME],string[256];
    GetPlayerName(RepairOffer[playerid], giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
    RepairCar[playerid] = GetPlayerVehicleID(playerid);
    RepairVehicle(RepairCar[playerid]);
format(string, sizeof(string), "Vase auto je popravljeno za $%d od strane mehanicara %s.",RepairPrice[playerid],giveplayer);
SCM(playerid, BELA, string);
format(string, sizeof(string), "Popravio si %s-ovo auto za $%d.",sendername,RepairPrice[playerid]);
SCM(RepairOffer[playerid], BELA, string);
AC_BS_GivePlayerMoney(playerid,RepairPrice[playerid]);
AC_BS_GivePlayerMoney(playerid, -RepairPrice[playerid]);
                    RepairOffer[playerid] = 999;
RepairPrice[playerid] = 0;
return 1;
                }
            }
        else return SCM(playerid, CRVENA, "{E0981B}SL:RP: {FFFFFF}Nemas dovoljno novca.");
    }
}
    return 1;
}
Poslednja Izmena: Jul 03, 2013, 20:39:56 POSLE PODNE od Alan ã‹¡


stavi ovako

YCMD:prihvati(playerid, params[], help)
{
    new param1[4];
if (sscanf(params, "s[4] ", param1)) {
        SendClientMessage(playerid, BELA, "|__________________ Opcije __________________|");
SendClientMessage(playerid, BELA, "  KORISCENJE: /prihvati [Opcija]");
SendClientMessage(playerid, BELA, "Dostupna Imena: Popravku");
SendClientMessage(playerid, BELA, "|____________________________________________|");
return 1;
    }
if(strcmp(param1,"popravku",true) == 0)
{
    if(RepairOffer[playerid] < 999)
        {
            if(GetPlayerMoney(playerid) > RepairPrice[playerid])
        {
            if(IsPlayerInAnyVehicle(playerid))
    {
new sendername[254];
new giveplayer[MAX_PLAYER_NAME],string[256];
    GetPlayerName(RepairOffer[playerid], giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
    RepairVehicle(GetPlayerVehicleID(playerid));
SetVehicleHealth(GetPlayerVehicleID(playerid), 1000);
format(string, sizeof(string), "Vase auto je popravljeno za $%d od strane mehanicara %s.",RepairPrice[playerid],giveplayer);
SCM(playerid, BELA, string);
format(string, sizeof(string), "Popravio si %s-ovo auto za $%d.",sendername,RepairPrice[playerid]);
SCM(RepairOffer[playerid], BELA, string);
AC_BS_GivePlayerMoney(playerid,RepairPrice[playerid]);
AC_BS_GivePlayerMoney(playerid, -RepairPrice[playerid]);
                    RepairOffer[playerid] = 999;
RepairPrice[playerid] = 0;
return 1;
                }
            }
        else return SCM(playerid, CRVENA, "{E0981B}SL:RP: {FFFFFF}Nemas dovoljno novca.");
    }
}
    return 1;
}
Other Dimension RolePlay | Uskoro
Ukoliko zelite pomoci u razvoju servera, mozete se meni javit na PP/PM!