GTA Közösség - A magyar GTA fórum

San Andreas Multiplayer (SA-MP) => SA-MP: Szerverfejlesztés => Segítségkérés => A témát indította: IwX - 2012. Január 23. - 21:38:09

Cím: Jó lesz így ez?
Írta: IwX - 2012. Január 23. - 21:38:09
[pawn]#include <a_samp>
#if defined FILTERSCRIPT
public OnPlayerCommandText(playerid, cmdtext[])
{
CMD:Segitség(playerid, params[])
{
   SendClientMessage(playerid,0x0000BBAA,\"Parancsok: /parancsok | Szabályok: /szabályok | Weboldal: /web\");
   return 1;
}
return 0;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
CMD:parancsok(playerid, params[])
{
   SendClientMessage(playerid,0x0000BBAA,\"Parancsok: /tele, /help, /ls, /sf, /lv, /v, /menu, /web\");
   return 1;
}
return 0;
}
#endif[/pawn]
Cím: Jó lesz így ez?
Írta: Flash - 2012. Január 23. - 21:45:23
Nem lesz így jó!
Ne tedd az OnPlayerCommandText alá mert ez zcmd-s parancs!
Tedd simán valahova a módodba.
Cím: Jó lesz így ez?
Írta: IwX - 2012. Január 23. - 21:51:12
És így:
[pawn]#include <a_samp>
#if defined FILTERSCRIPT
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(\"/Segitség\", cmdtext, true, 10) == 0)
{
   SendClientMessage(playerid,0x0000BBAA,\"Parancsok: /parancsok | Szabályok: /szabályok | Weboldal: /web\");
   return 1;
}
return 0;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp(\"/parancsok\", cmdtext, true, 10) == 0)
{
   SendClientMessage(playerid,0x0000BBAA,\"Parancsok: /tele, /help, /ls, /sf, /lv, /v, /menu, /web\");
   return 1;
}
return 0;
}
#endif[/pawn]
Cím: Jó lesz így ez?
Írta: Flash - 2012. Január 23. - 21:53:00
public OnPlayerCommandText(playerid, cmdtext&#91;])
{
if (strcmp(\"/Segitség\", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,0x0000BBAA,\"Parancsok: /parancsok | Szabályok: /szabályok | Weboldal: /web\");
return 1;
}
    if (strcmp(\"/parancsok\", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,0x0000BBAA,\"Parancsok: /tele, /help, /ls, /sf, /lv, /v, /menu, /web\");
return 1;
}
return 0;
}

 
Így! :)
Cím: Jó lesz így ez?
Írta: IwX - 2012. Január 23. - 22:05:43
Kösz!
Megy a +1
Cím: Jó lesz így ez?
Írta: kurta999 - 2012. Január 23. - 22:16:17
ZCMD-s parancsokat a globális névtérbe kell írni, tehát nem bele semilyen callback-ba, csak simán a módba.
Ezenkívül pedig nem kezeli az ékezetes karaktereket.