Szerző Téma: /Announce  (Megtekintve 1083 alkalommal)

Nem elérhető Cappsy

  • Adminisztrátor
  • 2754
    • Profil megtekintése
/Announce
« Dátum: 2012. Június 10. - 17:02:32 »
0 Show voters
Valaki tudna nekem adni egy jól mûködõ announce parancsot?

Nem elérhető Erik3333

  • 945
  • SMF | phpBB | TS3 | PHP | HTML | CSS | JS | PAWN | JAVA
    • Profil megtekintése
/Announce
« Válasz #1 Dátum: 2012. Június 10. - 17:15:49 »
+1 Show voters
COMMAND:announce(playerid,params[])
{
    if(isnull(params)) return SendClientMessage(playerid, -1, \"Használat: /announce [szöveg]\");
    GameTextForAll(params,5000,3);
    return 1;
}

 
Vagy:
 
if(strcmp(cmdtext, \"/announce\", true))
{
    new
        string[ 128 ],
        idx
    ;
    if(!IsPlayerAdmin(playerid)) return 0;
    new length = strlen(cmdtext);
    while ((idx < length) && (cmdtext[idx] <= \' \'))
    {
        idx++;
    }
    new offset = idx;
    new result[64];
    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
    {
        result[idx - offset] = cmdtext[idx];
        idx++;
    }
    result[idx - offset] = EOS;
    if(!strlen(result)) return SendClientMessage(playerid, -1, \"Használat: /announce [szöveg]\");
    format(string, sizeof(string), \"%s\", result);
    GameTextForAll(string, 5000, 3);
    return 1;
}

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
/Announce
« Válasz #2 Dátum: 2012. Június 10. - 18:58:05 »
+1 Show voters
Vagy ami még mûködik is:
 
new param;

 

CMD:announce(playerid, params[]) {
if(sscanf(params, \"s[256]\", param)) return SendClientMessage(playerid, 0xFF9933AA, \"Használat: {FFFFFF}/announce [szöveg]\");
else
{
    format(GameString, sizeof GameString, \"%s\", param);
GameTextForAll(GameString, 3000, 3);
}
return 1;
}

/Announce
« Válasz #3 Dátum: 2012. Június 10. - 20:32:14 »
+1 Show voters
Itt van az amit az admin rendszerembe irtam:
 
CMD:announce(playerid, params[])
{
    if(CESRAdminisztrator(playerid))
{
new szoveg[128];
if(sscanf(params, \"s[128]\", szoveg)) return SendClientMessage(playerid, PIROS, \"Használat: /announce [szöveg]\");
GameTextForAll(szoveg, 8000, 3);
}
else
{
SendClientMessage(playerid, 0xFF0000AA, \"Nem vagy adminisztrátor!\");
}
return 1;
}

Nem elérhető Norby

  • 1575
    • Profil megtekintése
/Announce
« Válasz #4 Dátum: 2012. Június 11. - 14:37:19 »
+1 Show voters
CMD:announce(playerid,params[])
{
new szoveg[256],idx;
szoveg = strtok(params,idx);
if(isnull(params)) return SendClientMessage(playerid,-1,\"Használat: /announce [szöveg]\");
GameTextForAll(szoveg,5000,3);
return 1;
}

 
Tipp: fixchars.inc-et használj az ékezetes betûk miatt.

Nem elérhető Cappsy

  • Adminisztrátor
  • 2754
    • Profil megtekintése
/Announce
« Válasz #5 Dátum: 2012. Június 11. - 18:09:36 »
0 Show voters
Ifes Parancsba valaki létszí

Nem elérhető Erik3333

  • 945
  • SMF | phpBB | TS3 | PHP | HTML | CSS | JS | PAWN | JAVA
    • Profil megtekintése
/Announce
« Válasz #6 Dátum: 2012. Június 11. - 18:10:34 »
0 Show voters
Idézetet írta: cappsy date=1339430976\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"22661\" data-ipsquote-contentclass=\"forums_Topic
Ifes Parancsba valaki létszí
 
Kifejtenéd bõvebben?

Nem elérhető Cappsy

  • Adminisztrátor
  • 2754
    • Profil megtekintése
/Announce
« Válasz #7 Dátum: 2012. Június 11. - 18:34:13 »
0 Show voters
nem zcmdset

Nem elérhető Pedró

  • 3341
  • 2014 © Az év Szkriptere
    • Profil megtekintése
/Announce
« Válasz #8 Dátum: 2012. Június 11. - 19:42:24 »
0 Show voters
if(!strcmp(cmdtext, \"/announce\")) {
    new
        string[ 128 ],
        idx
    ;
    if(!IsPlayerAdmin(playerid)) return 0;
    new length = strlen(cmdtext);
    while ((idx < length) && (cmdtext[idx] <= \' \'))
    {
        idx++;
    }
    new offset = idx;
    new result[64];
    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
    {
        result[idx - offset] = cmdtext[idx];
        idx++;
    }
    result[idx - offset] = EOS;
    if(!strlen(result)) return SendClientMessage(playerid, -1, \"Használat: /announce [szöveg]\");
    format(string, sizeof(string), \"%s\", result);
    GameTextForAll(string, 5000, 3);
    return 1;
}

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal