Jump to content

Question

Posted

Problema /afk.

Cand cineva da /afk, apare pe ecran "NAME este afk acum." si asa ramane.

Cum fac sa ramana doar 2 secunde sau foarte putin? Ca nu e ok sa ramana scris.. :undecided:

www.youtube.com/thebwgg

18 answers to this question

Recommended Posts

Posted

uite aici:

[pawn]

new afk[256];

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

        format(afk, sizeof(afk), "~r~ ~n~  ~n~  ~n~  ~n~  ~n~  ~n~  ~n~ ~n~ ~n~ ~r~ %s ~w~ will AFK.", name);

        GameTextForAll(afk,4000,3);

[/pawn]

Fara reclama in semnatura!

Posted

Am pus:

new afk[256];

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

        format(afk, sizeof(afk), "~r~ ~n~  ~n~  ~n~  ~n~  ~n~  ~n~  ~n~ ~n~ ~n~ ~r~ %s ~w~ will AFK.", name);

        GameTextForAll(afk,4000,3);

in locul la asta:

afk = TextDrawCreate(17.0, 280.0, "~w~este acum ~r~AFK");

  TextDrawBackgroundColor(afk, 255);

  TextDrawFont(afk, 2);

  TextDrawUseBox(afk, 1);

  TextDrawBoxColor(afk, 0x00000044);

  TextDrawTextSize(afk, 270.000000, 350.000000);

  TextDrawAlignment(afk, 0);

  TextDrawLetterSize(afk, 0.299999,1.000000);

  TextDrawColor(afk,0x000000ff);

  TextDrawSetOutline(afk, 1);

  TextDrawSetProportional(afk, 1);

Si imi da erori.

www.youtube.com/thebwgg

Posted

Am pus:

new afk[256];

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

        format(afk, sizeof(afk), "~r~ ~n~  ~n~  ~n~  ~n~  ~n~  ~n~  ~n~ ~n~ ~n~ ~r~ %s ~w~ este acum AFK.", name);

        GameTextForAll(afk,4000,3);

afk = TextDrawCreate(17.0, 280.0, "~w~este acum ~r~AFK");

  TextDrawBackgroundColor(afk, 255);

  TextDrawFont(afk, 2);

  TextDrawUseBox(afk, 1);

  TextDrawBoxColor(afk, 0x00000044);

  TextDrawTextSize(afk, 270.000000, 350.000000);

  TextDrawAlignment(afk, 0);

  TextDrawLetterSize(afk, 0.299999,1.000000);

  TextDrawColor(afk,0x000000ff);

  TextDrawSetOutline(afk, 1);

  TextDrawSetProportional(afk, 1);

Si imi da erori.

New GameMode In Development!-Romania Team Gang War-100%!...Datimi doua Motive afrimative de ce sa-l postez si-l postez...

Posted

Multumesc, dar eu vreau sa nu mai ramana in continuu "NAME este afk acum". Vreau sa apara 2 secunde si sa dispara. :undecided:

www.youtube.com/thebwgg

Posted

ma uite fak eu acum pe loc un afk

[pawn]

#include <a_samp>

#include <Colors>

new AFK[MAX_PLAYERS];

public OnFilterScriptInit()

{

}

public OnFilterScriptExit()

{

}

public OnPlayerConnect(playerid)

{

AFK[playerid]=0;

}

public OnPlayerDisconnect(playerid)

{

AFK[playerid]=0;

}

public OnPlayerCommandText(playerid,cmdtext[])

{

if(strcmp("/AFK",cmdtext,true) ==0)

{

new name[MAX_PLAYER_NAME];

new msg[100];

format(msg,sizeof(msg),"%s is now AFK!",name);

SendClientMessageToAll(COLOR_RED,msg);

TogglePlayerControllable(playerid,0);

return 1;

}

if(strcmp("/back",cmdtext,true) ==0)

{

new bakmsg[100];

new name[MAX_PLAYER_NAME];

format(bakmsg,sizeof(bakmsg),"%s has back",name);

SendClientMessageToAll(COLOR_RED,bakmsg);

TogglePlayerControllable(playerid,1);

return 1;

}

return 1;

}

[/pawn]

poftim acesta trimite un mesaj ca playerul este afk si il pune pe freeze facand ca nimeni sa nu-i mai poata lua din viata.);

iti va trebui

Colors

http://www.xerom-zone.ro/index.php?action=includeaici

Care il iei mai sus

New GameMode In Development!-Romania Team Gang War-100%!...Datimi doua Motive afrimative de ce sa-l postez si-l postez...

Posted

Mi-a zis si Speedy ce trebuie sa scriu !!! DAR UNDEEEEEEEE ?

Asta e comanda /afk a mea:

afk = TextDrawCreate(17.0, 280.0, "~w~este acum ~r~AFK");

  TextDrawBackgroundColor(afk, 255);

  TextDrawFont(afk, 2);

  TextDrawUseBox(afk, 1);

  TextDrawBoxColor(afk, 0x00000044);

  TextDrawTextSize(afk, 270.000000, 350.000000);

  TextDrawAlignment(afk, 0);

  TextDrawLetterSize(afk, 0.299999,1.000000);

  TextDrawColor(afk,0x000000ff);

  TextDrawSetOutline(afk, 1);

  TextDrawSetProportional(afk, 1);

CUM FAC SA NU MAI RAMANA "....ESTE ACUM AFK" ? Sa ramana doar 2 secunde.

www.youtube.com/thebwgg

Posted

Mi-a zis si Speedy ce trebuie sa scriu !!! DAR UNDEEEEEEEE ?

Asta e comanda /afk a mea:

afk = TextDrawCreate(17.0, 280.0, "~w~este acum ~r~AFK");

  TextDrawBackgroundColor(afk, 255);

  TextDrawFont(afk, 2);

  TextDrawUseBox(afk, 1);

  TextDrawBoxColor(afk, 0x00000044);

  TextDrawTextSize(afk, 270.000000, 350.000000);

  TextDrawAlignment(afk, 0);

  TextDrawLetterSize(afk, 0.299999,1.000000);

  TextDrawColor(afk,0x000000ff);

  TextDrawSetOutline(afk, 1);

  TextDrawSetProportional(afk, 1);

CUM FAC SA NU MAI RAMANA "....ESTE ACUM AFK" ? Sa ramana doar 2 secunde.

Inlocuieste aia cu un GameText, GameTextShowForAll: http://wiki.sa-mp.com/wiki/GameTextShowForAll
Posted

1.Nu e nimic concret in link-ul pe care mi l-ai dat.

2.Cum pot sa rezolv la /afk de la mine ?

Adica sa raman cu acelasi sistem /afk, dar sa nu-mi ramana pe ecran knd scrie cineva /afk.

www.youtube.com/thebwgg

Posted

[pawn]

#include <a_samp>

#include <Colors>

new AFK[MAX_PLAYERS];

public OnFilterScriptInit()

{

}

public OnFilterScriptExit()

{

}

public OnPlayerConnect(playerid)

{

AFK[playerid]=0;

}

public OnPlayerDisconnect(playerid)

{

AFK[playerid]=0;

}

public OnPlayerCommandText(playerid,cmdtext[])

{

if(strcmp("/AFK",cmdtext,true) ==0)

{

new name[MAX_PLAYER_NAME];

new msg[100];

format(msg,sizeof(msg),"%s is now AFK!",name);

GameTextForAll(msg,3000,2);

TogglePlayerControllable(playerid,0);

return 1;

}

if(strcmp("/back",cmdtext,true) ==0)

{

new bakmsg[100];

new name[MAX_PLAYER_NAME];

format(bakmsg,sizeof(bakmsg),"%s has back",name);

GameTextForAll(bakmsg,3000,2);

TogglePlayerControllable(playerid,1);

return 1;

}

return 1;

}

[/pawn]

incearca asa

si daca tot vrei cu textdraw

deci comanda

[pawn]

if(strcmp("/afk",cmdtext,true) ==0)

{

new name[MAX_PLAYER_NAME];

new afk[100];

format(afk,sizeof(msg),"%s is now AFK!",name);

afk = TextDrawCreate(17.0, 280.0, "~w~este acum ~r~AFK");

  TextDrawBackgroundColor(afk, 255);

  TextDrawFont(afk, 2);

  TextDrawUseBox(afk, 1);

  TextDrawBoxColor(afk, 0x00000044);

  TextDrawTextSize(afk, 270.000000, 350.000000);

  TextDrawAlignment(afk, 0);

  TextDrawLetterSize(afk, 0.299999,1.000000);

  TextDrawColor(afk,0x000000ff);

  TextDrawSetOutline(afk, 1);

  TextDrawSetProportional(afk, 1);

TogglePlayerControllable(playerid,0);

SetTimer("DestroyTextDraw",3000,0);

return 1;

}

[/pawn]

si in afara oricarui callback adick Exp public OnPlayerConnect(...)...

adica

exp

public OnPlayerConnect(playerid)
{
}
forward DestroyTextDraw();
public DestroyTextDraw()
{
TextDrawHideForAll(afk);
}

New GameMode In Development!-Romania Team Gang War-100%!...Datimi doua Motive afrimative de ce sa-l postez si-l postez...

Posted

Am inlocuit if(strcmp(cmdtext, "/afk", true) == 0)

{

GetPlayerName(playerid, dname, MAX_PLAYER_NAME);

format(newtext, sizeof(newtext), "~b~%s,~w~este acum ~r~AFK", dname);

TogglePlayerControllable(playerid,0);

SetPlayerVirtualWorld(playerid, 5);

TextDrawSetString(afk, newtext);

HideDraw(playerid);

TextDrawShowForAll(afk);

SetTimerEx("HideDraw", 3000, 0, "i", playerid);

KillTimer(Timer);

Timer = SetTimer("healme", 100, 1);

return 1;

}

Cu:

if(strcmp("/afk",cmdtext,true) ==0)

{

new name[MAX_PLAYER_NAME];

new afk[100];

format(afk,sizeof(msg),"%s is now AFK!",name);

afk = TextDrawCreate(17.0, 280.0, "~w~este acum ~r~AFK");

  TextDrawBackgroundColor(afk, 255);

  TextDrawFont(afk, 2);

  TextDrawUseBox(afk, 1);

  TextDrawBoxColor(afk, 0x00000044);

  TextDrawTextSize(afk, 270.000000, 350.000000);

  TextDrawAlignment(afk, 0);

  TextDrawLetterSize(afk, 0.299999,1.000000);

  TextDrawColor(afk,0x000000ff);

  TextDrawSetOutline(afk, 1);

  TextDrawSetProportional(afk, 1);

TogglePlayerControllable(playerid,0);

SetTimer("DestroyTextDraw",3000,0);

return 1;

}

Si uite ce-a iesit:

D:\[RSG]\gamemodes\RSG.pwn(3649) : warning 219: local variable "afk" shadows a variable at a preceding level

D:\[RSG]\gamemodes\RSG.pwn(3650) : error 017: undefined symbol "msg"

D:\[RSG]\gamemodes\RSG.pwn(3650) : error 029: invalid expression, assumed zero

D:\[RSG]\gamemodes\RSG.pwn(3650) : warning 215: expression has no effect

D:\[RSG]\gamemodes\RSG.pwn(3651) : error 033: array must be indexed (variable "afk")

D:\[RSG]\gamemodes\RSG.pwn(3652) : error 035: argument type mismatch (argument 1)

D:\[RSG]\gamemodes\RSG.pwn(3653) : error 035: argument type mismatch (argument 1)

D:\[RSG]\gamemodes\RSG.pwn(3654) : error 035: argument type mismatch (argument 1)

D:\[RSG]\gamemodes\RSG.pwn(3655) : error 035: argument type mismatch (argument 1)

D:\[RSG]\gamemodes\RSG.pwn(3656) : error 035: argument type mismatch (argument 1)

D:\[RSG]\gamemodes\RSG.pwn(3657) : error 035: argument type mismatch (argument 1)

D:\[RSG]\gamemodes\RSG.pwn(3658) : error 035: argument type mismatch (argument 1)

D:\[RSG]\gamemodes\RSG.pwn(3659) : error 035: argument type mismatch (argument 1)

D:\[RSG]\gamemodes\RSG.pwn(3660) : error 035: argument type mismatch (argument 1)

D:\[RSG]\gamemodes\RSG.pwn(3661) : error 035: argument type mismatch (argument 1)

www.youtube.com/thebwgg

Posted

atunci fa asa

[pawn]

#include <a_samp>

#include <Colors>

new AFK[MAX_PLAYERS];

public OnFilterScriptInit()

{

}

public OnFilterScriptExit()

{

}

public OnPlayerConnect(playerid)

{

AFK[playerid]=0;

}

public OnPlayerDisconnect(playerid)

{

AFK[playerid]=0;

}

public OnPlayerCommandText(playerid,cmdtext[])

{

if(strcmp("/AFK",cmdtext,true) ==0)

{

new name[MAX_PLAYER_NAME];

new msg[100];

format(msg,sizeof(msg),"%s is now AFK!",name);

GameTextForAll(msg,3000,2);

TogglePlayerControllable(playerid,0);

return 1;

}

if(strcmp("/back",cmdtext,true) ==0)

{

new bakmsg[100];

new name[MAX_PLAYER_NAME];

format(bakmsg,sizeof(bakmsg),"%s has back",name);

GameTextForAll(bakmsg,3000,2);

TogglePlayerControllable(playerid,1);

return 1;

}

[/pawn]

New GameMode In Development!-Romania Team Gang War-100%!...Datimi doua Motive afrimative de ce sa-l postez si-l postez...

Posted

TheBoss" post="75042" timestamp="1306691652"]

atunci fa asa

[pawn]

#include <a_samp>

#include <Colors>

new AFK[MAX_PLAYERS];

public OnFilterScriptInit()

{

}

public OnFilterScriptExit()

{

}

public OnPlayerConnect(playerid)

{

AFK[playerid]=0;

}

public OnPlayerDisconnect(playerid)

{

AFK[playerid]=0;

}

public OnPlayerCommandText(playerid,cmdtext[])

{

if(strcmp("/AFK",cmdtext,true) ==0)

{

new name[MAX_PLAYER_NAME];

new msg[100];

format(msg,sizeof(msg),"%s is now AFK!",name);

GameTextForAll(msg,3000,2);

TogglePlayerControllable(playerid,0);

return 1;

}

if(strcmp("/back",cmdtext,true) ==0)

{

new bakmsg[100];

new name[MAX_PLAYER_NAME];

format(bakmsg,sizeof(bakmsg),"%s has back",name);

GameTextForAll(bakmsg,3000,2);

TogglePlayerControllable(playerid,1);

return 1;

}

[/pawn]

AJUTA-L SA-L FACA PE AL LUI ! NU II FACE TU ALTUL ! Daca nu stii, nu te mai baga !

In loc de

[pawn]if(strcmp("/afk",cmdtext,true) ==0)

{

new name[MAX_PLAYER_NAME];

new afk[100];

format(afk,sizeof(msg),"%s is now AFK!",name);

afk = TextDrawCreate(17.0, 280.0, "~w~este acum ~r~AFK");

  TextDrawBackgroundColor(afk, 255);

  TextDrawFont(afk, 2);

  TextDrawUseBox(afk, 1);

  TextDrawBoxColor(afk, 0x00000044);

  TextDrawTextSize(afk, 270.000000, 350.000000);

  TextDrawAlignment(afk, 0);

  TextDrawLetterSize(afk, 0.299999,1.000000);

  TextDrawColor(afk,0x000000ff);

  TextDrawSetOutline(afk, 1);

  TextDrawSetProportional(afk, 1);

TogglePlayerControllable(playerid,0);

SetTimer("DestroyTextDraw",3000,0);

return 1;

}[/pawn]

pune

[pawn]if(strcmp("/afk",cmdtext,true) ==0)

{

new name[MAX_PLAYER_NAME], string[128];

GetPlayerName( playerid, name, MAX_PLAYER_NAME );

format(string, 128, "~w~%s is now AFK!",name);

GameTextForAll( string, 2000, 1 );

TogglePlayerControllable(playerid,0);

SetTimer("DestroyTextDraw",3000,0);

return 1;

}[/pawn]

Posted

Stuntman,am pus cum mi-ai zis si mi-a dat un warning:

D:\[RSG]\gamemodes\RSG.pwn(3648) : warning 219: local variable "string" shadows a variable at a preceding level

www.youtube.com/thebwgg

Posted

Stuntman,am pus cum mi-ai zis si mi-a dat un warning:

D:\[RSG]\gamemodes\RSG.pwn(3648) : warning 219: local variable "string" shadows a variable at a preceding level

[pawn]if(strcmp("/afk",cmdtext,true) ==0)

{

new name[MAX_PLAYER_NAME], string[128];

GetPlayerName( playerid, name, MAX_PLAYER_NAME );

format(string, 128, "~w~%s is now AFK!",name);

GameTextForAll( string, 2000, 1 );

TogglePlayerControllable(playerid,0);

SetTimer("DestroyTextDraw",3000,0);

return 1;

}[/pawn]

inlocuieste cu

[pawn]if(strcmp("/afk",cmdtext,true) ==0)

{

new name[MAX_PLAYER_NAME], afkstringa[128];

GetPlayerName( playerid, name, MAX_PLAYER_NAME );

format(afkstringa, 128, "~w~%s is now AFK!",name);

GameTextForAll( afkstringa, 2000, 1 );

TogglePlayerControllable(playerid,0);

return 1;

}[/pawn]

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.