Jump to content
  • 0

pomoc Fake Quit


Bgurf

Dotaz

11 odpovědí na tuto otázku

Recommended Posts

  • 0

díky moc za rady :)

 

Hele lidi už jsem udělal ten script ale když ho dám na server tak ten server spadne tu mám code

#include <a_samp>
#if defined FILTERSCRIPT
#define BARVA_SEDA 0xAFAFAFAA
#define SCM SendClientMessage
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
public OnFilterScriptInit()
{
   print("\n--------------------------------------");
   print(" Fake Quit v1.0 By Sempoinus1");
   print("--------------------------------------\n");
   return 1;
}

public OnFilterScriptExit()
{
   return 1;
}
#else
#endif

public OnPlayerCommandText(playerid, cmdtext[])
{
   if (strcmp(cmdtext, "/fq", true) == 0)
   {
    // Send a message to everyone.
    SendClientMessageToAll(0xAFAFAFAA, "Hráč %s opustil server.(Pád hry)");
    SetPlayerColor(playerid, 0x000000);
    return 1;
   }
   return 0;
}

Link to comment
Share on other sites

  • 0


#include <a_samp>
#if defined FILTERSCRIPT
#define BARVA_SEDA 0xAFAFAFAA
#define SCM SendClientMessage
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Fake Quit v1.0 By Sempoinus1");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}
#else
#endif

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp(cmdtext, "/fq", true) == 0)
    {
		    new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
               GetPlayerName(playerid, name, sizeof(name));

		    SendClientMessageToAll(0xAFAFAFAA, "Hráč %s opustil server.(Pád hry)");
		    SetPlayerColor(playerid, 0x000000);
		    return 1;
    }
    return 0;
}


 

skús zmazať

#else

#endif

 

a DCMD define ti netreba, kedže máš Strcmp, taktiež vymaž.

 

Musis takto

new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];

GetPlayerName(playerid, name, sizeof(name));

SendClientMessageToAll(0xAFAFAFAA, "Hráč %s opustil server.(Pád hry)");

  • Líbí se mi to! (+1) 1
Link to comment
Share on other sites

  • 0
#include <a_samp>
public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Fake Quit v1.0 By Sempoinus1");
    print("--------------------------------------\n");
    return 1;
}
public OnFilterScriptExit()
{
    return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp(cmdtext, "/fq", true) == 0)
    {
		    new name[30];
		    new sprava[100];
		    GetPlayerName(playerid, name, 30);
		    format(sprava,100, "Hráč %s opustil server.(Pád hry)",name);
		    SendClientMessageToAll(0xAFAFAFAA,sprava);
		    SetPlayerColor(playerid, 0x000000);
		    return 1;
    }
    return 0;
}

Link to comment
Share on other sites

  • 0

funkce

SendClientMessageToAll

 

Jen a pouze odesila text

 

A tet hadej proc kdyz do chatu napises % tak se tam napise # ? Protoze %s pouziva funkce format pro dosazovani textu a nedokaze ho odeslat jako znak.

 

Takze si zpravu musis nejdrive dosadit pomoci funkce format

 

new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
new string[128];
format(string,sizeof(string),"Hráč %s opustil server.(Pád hry)",name);
SendClientMessageToAll(0xAFAFAFAA,string);

 

Jinak to %s neznamena dosazeni nicku, ale dosazeni jakehokoliv textu %d je zase cislo a %.f je desetine cislo

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...