Szerző Téma: Biroság  (Megtekintve 1853 alkalommal)

Biroság
« Dátum: 2010. Május 11. - 06:02:30 »
0 Show voters
Helo én egy olyan Scriptet akarok hogy amikor a rendor el kapja a bunozott akkor aszt el vinni a biroságra és tanuk is oda be tudnak jonni
A parancs ezz lenne jó /biroság neve/id vagy tok mindegy

Nem elérhető Black

Biroság
« Válasz #1 Dátum: 2010. Május 11. - 16:01:30 »
0 Show voters
ez rohadtul felesleges. :D beviszed a rendorségre és oda betudnak jönni tanúskodni. ennyi a téma. de ha elmondod h mit csináljon az a parancs h /bíróság akkor segítek megcsinálni (ha tudok)

Nem elérhető maark

  • 565
    • Profil megtekintése
Biroság
« Válasz #2 Dátum: 2010. Május 11. - 17:21:19 »
0 Show voters
LAdminba van egy olyan parancs hogy /jail
=D

Nem elérhető krisk

  • 2380
    • Profil megtekintése
Biroság
« Válasz #3 Dátum: 2010. Május 11. - 19:15:13 »
0 Show voters
Globális változó:
 
new bool:birosag[MAX_PLAYERS] = false;

 

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(\"/birosag\", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid,0.0,0.0,0.0); // módosítsd amire akarod
                birosag[playerid] = true;
return 1;
}
return 0;
}

 
És ha akarsz valamit meghívni akkor ezentúl használhatod ezt:
 
if(birosag[playerid] = true) // Magyarul bíróságon vagy

Biroság
« Válasz #4 Dátum: 2010. Május 11. - 19:20:57 »
0 Show voters
Ezzel magad a birosag ele allitod xD  ::|

Biroság
« Válasz #5 Dátum: 2010. Május 11. - 19:57:18 »
0 Show voters
Eszt Melyik PWn fájlba kell be rakni??

Nem elérhető Mambo

  • 4239
    • Profil megtekintése
Biroság
« Válasz #6 Dátum: 2010. Május 11. - 20:05:38 »
0 Show voters
Idézetet írta: kukri1994 date=1273600638\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"1623\" data-ipsquote-contentclass=\"forums_Topic
Eszt Melyik PWn fájlba kell be rakni??
 
OnPlayerCommandText, a másikat meg ahol használod

Nem elérhető maark

  • 565
    • Profil megtekintése
Biroság
« Válasz #7 Dátum: 2010. Május 11. - 20:58:10 »
0 Show voters
eloször:
 
public OnPlayerCommandText(playerid, cmdtext[])
{
    new tmp[64], cmd[64], string[128];
    new giveplayerid, idx;
    cmd = strtok(cmdtext, idx), tmp = strtok(cmdtext, idx);
    giveplayerid = strval(tmp);
    if(strcmp(cmd, \"/birosag\", true) == 0)
{
if(GetPlayerTeam(playerid) == 0) //nem tudom melyik TEAM id a rendoröké úgyhogy majd írd át
          {
              if(!strlen(tmp))
      {
         return SendClientMessage(playerid, 0xFB0000FF, \"Használat: /birosag [playerid]\");
      }
           if(giveplayerid == playerid)
      {
         SendClientMessage(playerid, 0xFB0000FF, \"HIBA: Nem viheted magadat bíróság elé\");
         } else {
         if(IsPlayerConnected(giveplayerid))
         {
            //ide írd hogy mi történjen amikor beírja a parancsot
            SetPlayerPos(playerid, 1,1,1);// <-- például ez
             } else {
                 SendClientMessage(playerid, 0xFB0000FF, \"Nincs ilyen játékos!\");
            }
}
} else {
SendClientMessage(playerid,0xFB0000FF,\"Nem vagy admin!\");
}
return 1;
}
return 0;
}

 
aztán valahova (új sorba) rakd ezt:
 
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= \' \'))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > \' \') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}

 
és akkor így fog kinézni:
 
#include <a_samp>
public OnPlayerCommandText(playerid, cmdtext[])
{
    new tmp[64], cmd[64];
    new giveplayerid, idx;
    cmd = strtok(cmdtext, idx), tmp = strtok(cmdtext, idx);
    giveplayerid = strval(tmp);
    if(strcmp(cmd, \"/birosag\", true) == 0)
{
if(GetPlayerTeam(playerid) == 0)
          {
              if(!strlen(tmp))
      {
         return SendClientMessage(playerid, 0xFB0000FF, \"Használat: /birosag [playerid]\");
      }
           if(giveplayerid == playerid)
      {
         SendClientMessage(playerid, 0xFB0000FF, \"HIBA: Nem viheted magadat bíróság elé\");
         } else {
         if(IsPlayerConnected(giveplayerid))
         {
            //ide írd hogy mi történjen amikor beírja a parancsot
            SetPlayerPos(playerid, 1,1,1);// <-- például ez
             } else {
                 SendClientMessage(playerid, 0xFB0000FF, \"Nincs ilyen játékos!\");
            }
}
} else {
SendClientMessage(playerid,0xFB0000FF,\"Nem vagy admin!\");
}
return 1;
}
return 0;
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= \' \'))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > \' \') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}

 
remélem segítettem =D

Nem elérhető kurta999

  • 2759
  • Éllő fédisznó
    • Profil megtekintése
Biroság
« Válasz #8 Dátum: 2010. Május 11. - 22:27:58 »
0 Show voters
Nem egyszerubb ? :D (Nem teszteltem, nem biztos h muködik)
 

#include <a_samp>
#include <zcmd> // http://forum.sa-mp.com/index.php?topic=116240.0
#include <sscanf2> // http://forum.sa-mp.com/index.php?topic=145539.0
CMD:birosag(playerid, params[])
{
   new player1;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFB0000FF,\"Nem vagy admin!\");
if(sscanf(params, \"u\", player1)) return SendClientMessage(playerid, 0xFB0000FF, \"Használat: /birosag [Játékos ID/Név]\");
   if(!IsPlayerConnected(player1)) return SendClientMessage(playerid, 0xFB0000FF, \"Nincs ilyen játékos!\");
if(player1 == playerid) return SendClientMessage(playerid, 0xFB0000FF, \"HIBA: Nem viheted magadat bíróság elé\");
//ide írd hogy mi történjen amikor beírja a parancsot
SetPlayerPos(player1, 1,1,1);// <-- például ez itt playerid helyett player1 et kell adni mert az az a játékos amit választunk
return 1;
}
« Utoljára szerkesztve: 2010. Május 11. - 22:32:27 írta kurta999 »

Biroság
« Válasz #9 Dátum: 2010. Május 12. - 13:03:52 »
0 Show voters
De eszt csináljam meg egy Uj PWN Fájlba vagy mi?

Nem elérhető kurta999

  • 2759
  • Éllő fédisznó
    • Profil megtekintése
Biroság
« Válasz #10 Dátum: 2010. Május 12. - 17:30:39 »
0 Show voters
Idézetet írta: kukri1994 date=1273662232\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"1623\" data-ipsquote-contentclass=\"forums_Topic
De eszt csináljam meg egy Uj PWN Fájlba vagy mi?
 
Igen

Biroság
« Válasz #11 Dátum: 2010. Május 12. - 17:31:18 »
0 Show voters
Eszt minden bele kell másolni egy PWN FÁJLBA

Biroság
« Válasz #12 Dátum: 2010. Május 12. - 17:32:00 »
0 Show voters
Hád de melyik kel keszdjem lekeloszor

Biroság
« Válasz #13 Dátum: 2010. Május 12. - 17:32:30 »
0 Show voters
A kód oti s másoljam oda

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal