Szerző Téma: [HELP] Automata és névre nyíló kapu  (Megtekintve 1497 alkalommal)

Nem elérhető ptlevi

  • 235
    • Profil megtekintése
[HELP] Automata és névre nyíló kapu
« Dátum: 2010. Június 16. - 14:08:32 »
0 Show voters
#define FILTERSCRIPT
#include <a_samp>
#include <a_objects>
#if defined FILTERSCRIPT
#define red 0xFF0000A
forward GateCheck(playerid);
new mygate;
 
public OnFilterScriptInit()
{
    mygate=CreateObject(980, 2293.5500488281, 1942.3273925781, 16.994842529297, 0, 0, 0); //object (kapu) ID és a koordinata
    SetTimer(\"GateCheck\",1000,1);
return 1;
}
 
public GateCheck(playerid)
{
new name[24];
if (strfind(name, \"[Knights]\", true) == -1)
    if(IsPlayerInRangeOfPoint(playerid,10.0,2293.5500488281, 1942.3273925781, 16.994842529297)) //object (kapu) koordinata
    {
MoveObject(mygate, 2305.0737304688, 1942.3419189453, 17.044841766357, 6.00);   //nyitott kapu koordinata a 6.00 a sebessége
}
else
{
MoveObject(mygate,2293.5500488281, 1942.3273925781, 16.994842529297, 6.00);   //zárt kapu koordinata
}
return 1;
}
#endif

 
Ezzel a paranccsal lenne bajom.
Azt szeretném megtudni hogy miért nyílik minden névre, miért nem csak azoknak akiknek benne van a nevükben hogy: [Knights]
Valaki megmondaná hogy mi a hibám? (pawno-ban 0 error, 0 warning)

[HELP] Automata és névre nyíló kapu
« Válasz #1 Dátum: 2011. Január 01. - 12:29:23 »
0 Show voters
Így esetleg mûködhet:
 
#include <a_samp>
#include <a_objects>
#define red 0xFF0000A
forward GateCheck(playerid);
new mygate;
public OnFilterScriptInit()
{
   mygate=CreateObject(980, 2293.5500488281, 1942.3273925781, 16.994842529297, 0, 0, 0); //object (kapu) ID és a koordinata
   SetTimer(\"GateCheck\",1000,1);
   return 1;
}
public GateCheck(playerid)
{
   new name[24];
   if(strfind(name, \"[Knights]\", true))
   {
   if(IsPlayerInRangeOfPoint(playerid,10.0,2293.5500488281, 1942.3273925781, 16.994842529297))     //object (kapu) koordinata
   {
   MoveObject(mygate, 2305.0737304688, 1942.3419189453, 17.044841766357, 6.00);   //nyitott kapu koordinata a 6.00 a sebessége
   }
   else
   {
   MoveObject(mygate,2293.5500488281, 1942.3273925781, 16.994842529297, 6.00);   //zárt kapu koordinata
   }
   } else return;
}

Nem elérhető ZeRo

  • 4620
  • Ex Globális Moderátor
    • Profil megtekintése
[HELP] Automata és névre nyíló kapu
« Válasz #2 Dátum: 2011. Január 01. - 13:12:09 »
0 Show voters
A név lekérése kimaradt.
 

new name[ 24 ];
GetPlayerName( playerid, name, sizeof name );

[HELP] Automata és névre nyíló kapu
« Válasz #3 Dátum: 2011. Január 01. - 13:20:09 »
0 Show voters
Nekem egy ugyan ilyen telés parancs-hoz nem kellett, anélkül is ment  :)  :amazed:

Nem elérhető ZeRo

  • 4620
  • Ex Globális Moderátor
    • Profil megtekintése
[HELP] Automata és névre nyíló kapu
« Válasz #4 Dátum: 2011. Január 01. - 13:43:27 »
0 Show voters
Idézetet írta: Stricica date=1293884409\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"2031\" data-ipsquote-contentclass=\"forums_Topic
Nekem egy ugyan ilyen telés parancs-hoz nem kellett, anélkül is ment  :)  :amazed:
 
Csak gondolj bele, hogyan ellenõrizné az adott játékos nevét, ha le sem kéri? :shy:

[HELP] Automata és névre nyíló kapu
« Válasz #5 Dátum: 2011. Január 01. - 13:44:30 »
0 Show voters
Hm, mondasz valamit :D

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal