Szerző Téma: STRCMP inclute pawnohoz  (Megtekintve 654 alkalommal)

[ZzZ]Álmos

  • Vendég
STRCMP inclute pawnohoz
« Dátum: 2012. Február 12. - 17:55:24 »
0 Show voters
Sziasztok! Tudtok küldeni STRCMP include-t pawnohoz? Scripthez kellene. Van ilyen egyáltalán? :D

Nem elérhető Sheet

  • 1508
  • Támogató
    • Profil megtekintése
STRCMP inclute pawnohoz
« Válasz #1 Dátum: 2012. Február 12. - 17:57:18 »
0 Show voters
Az strcmp az alapból benne van az a_samp-ban

[ZzZ]Álmos

  • Vendég
STRCMP inclute pawnohoz
« Válasz #2 Dátum: 2012. Február 12. - 17:58:37 »
0 Show voters
Idézetet írta: Sheet date=1329065838\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"16954\" data-ipsquote-contentclass=\"forums_Topic
Az strcmp az alapból benne van az a_samp-ban
 
Kösz. De miért errorozik ez akkor?
[pawn]if(strcmp(cmd, \"/time\", true) == 0)
{
new string[8];
if(sscanf(params, \"us[8]\", string)) return SendClientMessage(playerid, yellow2, \"Használd: /ido [0-24]\");
new TimeID;
TimeID = strval(params);
if(TimeID < 0 || TimeID > 24)
{
SendClientMessage(playerid, red, \"Ismeretlen idõt adtál meg! {A9C4E4}0-24 {E60000}között van!\");
}
else
{
SetPlayerTime(playerid, TimeID, TimeID);
}
return 1;
}[/pawn]

Nem elérhető Sheet

  • 1508
  • Támogató
    • Profil megtekintése
STRCMP inclute pawnohoz
« Válasz #3 Dátum: 2012. Február 12. - 17:59:57 »
0 Show voters
Ez a kód alapból rossz, valamint sscanfet nem lehet strcmp-vel használni.

Nem elérhető Csabesz

  • 7827
    • Profil megtekintése
STRCMP inclute pawnohoz
« Válasz #4 Dátum: 2012. Február 12. - 18:00:33 »
0 Show voters
Ezt így sose fogod mûködésre bírni.
Alap parancsnál nem tudod használni a sscanf-ot. Írd át zcmd-re vagy dcmd, esetleg sscanf helyett strtok

Nem elérhető DrAkE

  • 2078
    • Profil megtekintése
STRCMP inclute pawnohoz
« Válasz #5 Dátum: 2012. Február 12. - 19:05:32 »
0 Show voters
Idézetet írta: Yѕtee date=1329066033\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"16954\" data-ipsquote-contentclass=\"forums_Topic
Ezt így sose fogod mûködésre bírni.
Alap parancsnál nem tudod használni a sscanf-ot. Írd át zcmd-re vagy dcmd, esetleg sscanf helyett strtok
 
http://sampforum.hu/index.php?topic=20289.msg217336#msg217336
(bár az is lehet hogy feleslegesen csináltam...)

STRCMP inclute pawnohoz
« Válasz #6 Dátum: 2012. Február 12. - 20:18:50 »
+1 Show voters
Idézetet írta: Yѕtee date=1329066033\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"16954\" data-ipsquote-contentclass=\"forums_Topic
Ezt így sose fogod mûködésre bírni.
Alap parancsnál nem tudod használni a sscanf-ot. Írd át zcmd-re vagy dcmd, esetleg sscanf helyett strtok
 

Ez a kód alapból rossz, valamint sscanfet nem lehet strcmp-vel használni.
 
[/quote]
Miért ne lehetne használni?  :laugh:
[pawn]   if(strcmp(cmdtext, \"/time\", true, 5) == 0)
{
   new
      TimeID;
   if(sscanf(cmdtext, \"{s[6]}d\", TimeID)) return SendClientMessage(playerid, -1, \"Használat: /time [0-24]\");
   if(TimeID < 0 || TimeID > 24)
      SendClientMessage(playerid, -1, \"Ismeretlen idõt adtál meg! {A9C4E4}0-24 {E60000}között van!\");
   else
      SetPlayerTime(playerid, TimeID, 0);
   return 1;
}[/pawn]

[ZzZ]Álmos

  • Vendég
STRCMP inclute pawnohoz
« Válasz #7 Dátum: 2012. Február 12. - 20:25:00 »
0 Show voters
Jó zárom már megvan :) Köszi a segítséget.

Nem elérhető Csabesz

  • 7827
    • Profil megtekintése
STRCMP inclute pawnohoz
« Válasz #8 Dátum: 2012. Február 12. - 20:27:50 »
0 Show voters
Idézetet írta: ɐʞzssǝlosz date=1329074330\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"16954\" data-ipsquote-contentclass=\"forums_Topic
[pawn]
if(sscanf(cmdtext, \"{s[6]}d\", TimeID)) return SendClientMessage(playerid, -1, \"Használat: /time [0-24]\");
[/pawn]
 
Errõl én nem tudtam :D Most már ezzel is okosabb lettem.  :D

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal