[POMOC] YCMD:marama

Započeo Huan Escobar, Maj 22, 2016, 20:35:31 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Skripta koju koristim: UP
Detaljan opis problema: Ubacio sam da kada igrac stavi maramu da mu promeni ime u ((Maskiran)) ali mi ne ide da kada se kuca opet /marama i kada skine objekat sa sebe da mu se vrati ime na staro.
Dio skripte:
[pawn]
YCMD:marama(playerid, params[], help)
{
    #pragma unused help
      new masa[128];
   new sendername[64];
    if(UlogovanProvera[playerid] == 0) return SCM(playerid,-1,"LF:RP | "CRVENA"Moras se ulogovati da bi koristio ovu komandu!");
   if(Marama[playerid] == 0) return SCM(playerid,-1,""CRVENA"(GRESKA) "SIVA"Nemate maramu!");
   new string[80];
   if(Marama[playerid] == 1)
   {
      SetPlayerAttachedObject(playerid, MARAMA_SLOT, 18913, 2, -0.08, 0.03, 0.0, 90, -180, -90);
      format(string, sizeof(string), "* %s stavlja maramu.", GetName(playerid));
      ProxDetector(20.0, playerid, string, PROX,PROX,PROX,PROX,PROX);
      GetPlayerName(playerid, string, sizeof(string));
      strmid(OldUsername[playerid], string, 0, strlen(string), 64);
      format(masa,sizeof(masa), "((Maskiran))(%d)",playerid);
      SetPlayerName(playerid, masa);
      SCM(playerid,-1,""SPLAVA"Stavili ste maramu da je skinete kucajte /marama!");
      Marama[playerid] = 2;
   }
   else if(Marama[playerid] == 2)
   {
      RemovePlayerAttachedObject(playerid, MARAMA_SLOT);
      format(string, sizeof(string), "* %s skida maramu.", GetName(playerid));
      ProxDetector(20.0, playerid, string, PROX,PROX,PROX,PROX,PROX);
      GetPlayerName(playerid, sendername, sizeof(sendername));
      SCM(playerid,-1,""SPLAVA"Skinuli ste maramu da je ponovo stavite kucajte /marama!");
      Marama[playerid] = 1;
   }
   return 1;
}
[/pawn]
Neke slike/video za lakse dobivanje pomoci(neobavezno):

Tamo gde igrac skida maramu samo dodaj:
SetPlayerName(playerid, OldUsername[playerid]);
strmid(OldUsername[playerid], "", 0, strlen(""), 64);

ovo mu vraca ime na staro tj kako je bilo pre stavljanja marame i brise to ime iz varijable OldUsername.
Poslednja Izmena: Maj 22, 2016, 20:46:25 POSLE PODNE od Seiz

Evo ti komanda..
Code:
[pawn]
YCMD:marama(playerid, params[], help)
{
    #pragma unused help
    new budjavac[64];
if(Marama[playerid] == 0) return SCM(playerid,-1,""CRVENA"ERROR: {FFFFFF}Nemate maramu!");
   new string[80];
   if(Marama[playerid] == 1)
   {
        SetPlayerAttachedObject(playerid, MARAMA_SLOT, 18913, 2, -0.08, 0.03, 0.0, 90, -180, -90);
      format(string, sizeof(string), "* %s namesta svoju maramu na lice.", GetName(playerid));
      ProxDetector(20.0, playerid, string, PURPLE1,PURPLE2,PURPLE3,PURPLE4,PURPLE5);
       //dodatak koji mu seta Ime na Marama_ i rand broj
      GetPlayerName(playerid, budjavac, sizeof(budjavac));
      strmid(OldUsername[playerid], budjavac, 0, strlen(budjavac), 64);
      new ccc[12];
      new mask = randomEx(1,100000);
      format(ccc, sizeof(ccc), "Marama_%d",mask);
      SetPlayerName(playerid, ccc);
      //
      SCM(playerid,-1,"{1A94E6}* {FFFFFF}Stavili ste maramu da je skinete kucajte /marama!");
      Marama[playerid] = 2;
   }
   else if(Marama[playerid] == 2)
   {
        RemovePlayerAttachedObject(playerid, MARAMA_SLOT);
        SetPlayerName(playerid, OldUsername[playerid]);
      strmid(OldUsername[playerid], "Nema", 0, strlen("Nema"), 64);
      format(string, sizeof(string), "* %s skida maramu sa svog lica.", GetName(playerid));
      ProxDetector(20.0, playerid, string, PURPLE1,PURPLE2,PURPLE3,PURPLE4,PURPLE5);
      SCM(playerid,-1,"{1A94E6}* {FFFFFF}Skinuli ste maramu da je ponovo stavite kucajte /marama!");
      Marama[playerid] = 1;
   }
   return 1;
}
[/pawn]