Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: Kirali poslato Avgust 11, 2019, 18:32:45 POSLE PODNE

Naslov: Komanda RPPLUS reason undefine
Poruka od: Kirali poslato Avgust 11, 2019, 18:32:45 POSLE PODNE
Radim na komandi rpplus da ima razlog kada nekome das rpplus i naravno kad sam sve napravio kako treba "bar mislim" piise mi za reason undefine

[pawn]YCMD:rpplus( playerid, params[] )
{
    if( PlayerInfo[ playerid ][ xAdmin ] >= 5) return GRESKA( playerid, "Niste ovlasteni za ovu komandu!");
    if( !AdminDuty[ playerid ] ) return GRESKA( playerid, "Morate biti na Admin duznosti!" );
   new id;
   if( sscanf( params, "u", id ) )
   {
      SendUsageMessage( playerid, "/rpplus [ ID/Ime ] [ RAZLOG ]");
      return 1;
   }
   if( id == IPI ) return GRESKA( playerid, "Pogresan ID." );
   PlayerInfo[ id ][ xRPPoen ]++;
   SavePlayer( id );
   if( strlen( reason ) < 1 || strlen( reason ) > 31 ) return GRESKA( playerid, "Razlog ne moze biti duzi od 31 slova!");
   SendInfoMessage( playerid, "Dali ste RP Plus igracu %s.", ImeIgraca( id ) );
   SendInfoMessage( id, "Admin %s vam je dao RP Plus.", ImeIgraca( playerid ) );
   format( globalstring, sizeof( globalstring ), "{FF0000} RPPLUS  {C0C0C0}%s {FFFFFF}je dao RP Poen igracu {C0C0C0}%s {FF0000}Razlog:"col_white"%s", ImeIgraca( playerid ), ImeIgraca( id ), reason );
   SCMA( -1, globalstring );
   new string[ 128 ];
   format( string, sizeof( string ), "Admin %s je dao RP Plus igracu %s Razlog:"col_white"%s", ImeIgraca( playerid ), ImeIgraca( id ), reason );
   LogSave( "Ostalo/LogRPPlus.log", string );
   return 1;
}[/pawn]
Naslov: Odg: Komanda RPPLUS reason undefine
Poruka od: xLanmi poslato Avgust 11, 2019, 18:46:50 POSLE PODNE
[pawn]
        new id;
   if( sscanf( params, "u", id ) )
   {
      SendUsageMessage( playerid, "/rpplus [ ID/Ime ] [ RAZLOG ]");
      return 1;
   }
[/pawn]

Zameni sa

[pawn]
        new id,reason[40];
   if( sscanf( params, "us[40]", id, reason ) )
   {
      SendUsageMessage( playerid, "/rpplus [ ID/Ime ] [ RAZLOG ]");
      return 1;
   }
[/pawn]
Naslov: Odg: Komanda RPPLUS reason undefine
Poruka od: Kirali poslato Avgust 11, 2019, 18:59:32 POSLE PODNE
Moze pomoc za 1 jednu komandu  isto mi razlog nece ova je sistem da helper finuje igraca sa max 5k$ zbog rijecnika i tahvih stvari

[pawn]YCMD:hfine( playerid, params[] )
{
    if( PlayerInfo[ playerid ][ xHelper ] >= 4 )
   {
        if( !AdminDuty[ playerid ] ) return GRESKA( playerid, "Morate biti na Helper duznosti!" );
       new id, novac,;
      if( sscanf( params, "ud", id, novac, reason ) ) return SendUsageMessage( playerid, "/hfine [ ID/Ime ] [ NOVAC ] [ RAZLOG ]");
      if( id == playerid ) return GRESKA( playerid, "Ne mozes sam sebe finovati!");
      if( novac < 1 ) return GRESKA( playerid, "Novac ne moze ici ispod 1 !");
      if( novac > 5000 ) return GRESKA( playerid, "Novac ne moze ici preko 5000 !");
      if( id == IPI ) return GRESKA( playerid, "Igrac nije online!");
        if( strlen( reason ) < 1 || strlen( reason ) > 31 ) return GRESKA( playerid, "Razlog ne moze biti duzi od 31 slova!");
       if( PlayerInfo[ playerid ][ xAdmin ] < 6 && PlayerInfo[ id ][ xAdmin ] >= 6 ) return GRESKA( playerid, "Ne mozes finovati direktore i vlasnike!");
      DajIgracuNovac( id, -novac );
      format( globalstring , sizeof( globalstring ), ""col_white"Fineovani ste! Helper: "col_crvena"%s "col_white"Novac: "col_crvena"-%d" "Razlog: %s", ImeIgraca( playerid ), novac, reason );
      SCM( id, -1, globalstring );
      SendClientMessageEx( playerid, -1, "Fineovali ste igraca "col_crvena"%s "col_white"Novac: "col_crvena"- %d",ImeIgraca( id ), novac );
      format( globalstring, sizeof( globalstring ), "{FF0000} FINE  {C0C0C0}%s {FFFFFF}je oduzeo novac igracu: {C0C0C0}%s $ Razlog: %s", ImeIgraca( playerid ), ImeIgraca( id ), novac, reason );
      AdminPoruka( -1, globalstring );
        new string[ 128 ];
      format( string, sizeof( string ), "Helper %s je oduzeo novac igracu %s | Novac: -%d Razlog: %s", ImeIgraca( playerid ), ImeIgraca( id ), novac, reason );
      LogSave( "Ostalo/LogFine.log", string );
   }
   else return GRESKA( playerid, "Niste ovlasteni za ovu komandu!" );
   return 1;
}[/pawn]
Naslov: Odg: Komanda RPPLUS reason undefine
Poruka od: Muma poslato Avgust 11, 2019, 19:12:37 POSLE PODNE
Nauči osnovne stvari sscanfa mralee xd if( sscanf( params, "ud", id, novac, reason ) ) vidiš da imaš 3 parametra id novac reason, a ovamo "ud" samo i još ti reason nije definisan, a za pare imaš provjeru ako je ispod 1 i preko 5000 lul