Jump to content

AFK System [by Marw(in)37]


Recommended Posts

j do:OnPlayerKeyStateChange

 

-- sob 19. pro 2009 20:31:57 --

 

good ale pls help aby se vrátil z5 do hry chci aby napsal /afk ne aby zmačk mezerník poradí mi někdo jak na to prosííííííííím :)

Link to comment
Share on other sites

  • 1 month later...

promin ale vihadzuje mi to 3 chyby

(228) : error 017: undefined symbol "dcmd_afk"
(229) : error 017: undefined symbol "params"
(242) : warning 225: unreachable code
(242) : error 017: undefined symbol "dcmd_afk"
(368) : warning 219: local variable "string" shadows a variable at a preceding level

Link to comment
Share on other sites

  • 3 weeks later...

Zadne errory to nehazi a spoustu warovani...neim co s tim

 


C:\Documents and Settings\Lukyn\Plocha\SAMP\pawno\include\dutils.inc(28) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Lukyn\Plocha\SAMP\pawno\include\dutils.inc(132) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Lukyn\Plocha\SAMP\pawno\include\dutils.inc(172) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Lukyn\Plocha\SAMP\pawno\include\dutils.inc(280) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Lukyn\Plocha\SAMP\pawno\include\dutils.inc(337) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Lukyn\Plocha\SAMP\pawno\include\dutils.inc(379) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Lukyn\Plocha\SAMP\pawno\include\dini.inc(239) : warning 219: local variable "string" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


7 Warnings.


 

 

Ale v modu afk funguje jak mam... :?: nechapu

Myslim ze mam spatny includ nebo neco jineho...pls poradte mi nekdo...diiiky :thumbup:

Link to comment
Share on other sites

Zadne errory to nehazi a spoustu warovani...neim co s tim

 

 


C:\Documents and Settings\Lukyn\Plocha\SAMP\pawno\include\dutils.inc(28) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Lukyn\Plocha\SAMP\pawno\include\dutils.inc(132) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Lukyn\Plocha\SAMP\pawno\include\dutils.inc(172) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Lukyn\Plocha\SAMP\pawno\include\dutils.inc(280) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Lukyn\Plocha\SAMP\pawno\include\dutils.inc(337) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Lukyn\Plocha\SAMP\pawno\include\dutils.inc(379) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Lukyn\Plocha\SAMP\pawno\include\dini.inc(239) : warning 219: local variable "string" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


7 Warnings.


 

 

 

Ale v modu afk funguje jak mam... :?: nechapu

Myslim ze mam spatny includ nebo neco jineho...pls poradte mi nekdo...diiiky :thumbup:

 

proměnnou "string" zaměň třeba za "strg", nebo cokoli jiného. jde o to že include dutils už proměnnou string má definouvanou a zavedenou, je to nedomyšlený ale "string" už používat nemůžeš.

 

-- dnes, 07:14 --

 

_Killer":gsvv4f3g]promin ale vihadzuje mi to 3 chyby

(228) : error 017: undefined symbol "dcmd_afk"
(229) : error 017: undefined symbol "params"
(242) : warning 225: unreachable code
(242) : error 017: undefined symbol "dcmd_afk"
(368) : warning 219: local variable "string" shadows a variable at a preceding level

al už to tu je

#define dcmd(%1,%2,%3) if((strcmp((%3)[1],#%1,true,(%2))==0)&&((((%3)[(%2)+1]==0)&&(dcmd_%1(playerid,"")))||(((%3)[(%2)+1]==32)&&(dcmd_%1(playerid,(%3)[(%2)+2]))))) return 1

 

-- dnes, 07:17 --

 

:-D me to zas hlasi toto :p

 

 

C:\Users\David\Desktop\SF.pwn(382) : error 017: undefined symbol "AFK"

C:\Users\David\Desktop\SF.pwn(382) : warning 215: expression has no effect

C:\Users\David\Desktop\SF.pwn(382) : error 001: expected token: ";", but found "]"

C:\Users\David\Desktop\SF.pwn(382) : error 029: invalid expression, assumed zero

C:\Users\David\Desktop\SF.pwn(382) : fatal error 107: too many error messages on one line

 

 

Řádek 382:

 

 

AFK[playerid] = 0;

 

 

:p pls pomoct :-D

Nemáš ten new AFK[MAX_PLAYERS]; danej třeba pod #if defined FILTERSCRIPT

nebo nějakou jinou blbost?

Link to comment
Share on other sites

  • 5 months later...

nemaš, iba u pvars máš pri pripojení automaticky 0

skús si to zapni si server na localhost a daj si premenu npr. admin[playerid] = 5;

a odíd a vráť sa uvidíš že bude na 5

Link to comment
Share on other sites

Zdá se mi zbytečný do OnPlayerConnes psát afk[playerd] = 0;

Protože každou proměnnou máš při připojení automaticky 0 :-)

 

Na tu hovadinu co si teď napsal jsi narazil kde??

Link to comment
Share on other sites

Zdá se mi zbytečný do OnPlayerConnes psát afk[playerd] = 0;

Protože každou proměnnou máš při připojení automaticky 0 :-)

 

do OnPlayerConnes je to zbytečný ale do OnPlayerConnect není :)

Link to comment
Share on other sites

  • 4 weeks later...

ja by som navrhoval to truchu inak aj so zmenou mena a je to aj dobre tým že si v afk nepripočitaju čas takže asi takto:

 

dcmd_afk(playerid, params[])
{
#pragma unused params
//---------------------------------------|
if(IsPlayerConnected(playerid))
{
    new string[200], afkstring[256], afkstring2[256];

    if(Informace[playerid][AFK] == 0)
     {
     SendClientMessage(playerid,B_CERV, "[ AFK ] Pre zruseni statusu zopakujte /afk");
     format(string, 200, "[ AFK ] %s - Nachvilu prec. /afk",Jmeno(playerid));
     SendClientMessageToAll(B_SVIT,string);
     TogglePlayerControllable(playerid, 0);
     Informace[playerid][AFK] = 1;
     new text[70];
     format(text, sizeof(text), "Hrac: %s isiel na chvylu prec.", Jmeno(playerid));

     GetPlayerName(playerid, Informace[playerid][afkmeno], sizeof(afkstring));
     format(afkstring, sizeof(afkstring), "[AFK]%s", Informace[playerid][afkmeno]);
     SetPlayerName(playerid, afkstring);

	}else{

     SendClientMessage(playerid,B_CERV,"[ AFK ] Status zruseny.");
     format(string, 200, "[ AFK ] %s - Online.",Jmeno(playerid));
     SendClientMessageToAll(B_SVIT,string);
     TogglePlayerControllable(playerid, 1);
     Informace[playerid][AFK] = 0;

     new text[70];
     format(text, sizeof(text), "Hrac: %s sa vratil spat.", Jmeno(playerid));

     format(afkstring2, sizeof(afkstring2), "%s", Informace[playerid][afkmeno]);
     SetPlayerName(playerid, afkstring2);

     }	
     }
return 1;
}

 

dufam že to je dobre lebo som to iba obkopiroval z môjho modu

Link to comment
Share on other sites

technicky dotaz k čemu tam máš toto?

new text[70];
format(text, sizeof(text), "Hrac: %s isiel na chvylu prec.", Jmeno(playerid));

a nechapu tu podminku jestli je připojen... nepřipojený hráč asi těžko zadá příkaz :d

Link to comment
Share on other sites

fuj humus hnoj sračka odpor grcka

new string[200], afkstring[256], afkstring2[256];

fuj humus hnoj sračka odpor grcka 2

if(IsPlayerConnected(playerid))

{

 

a chýb ani nehovoriac...

Link to comment
Share on other sites

  • 2 months later...

#define dcmd(%1,%2,%3) if((strcmp((%3)[1],#%1,true,(%2))==0)&&((((%3)[(%2)+1]==0)&&(dcmd_%1(playerid,"")))||(((%3)[(%2)+1]==32)&&(dcmd_%1(playerid,(%3)[(%2)+2]))))) return 1

#define COLOR_YELLOW 0xFFFF00AA

 

new AFK[MAX_PLAYERS];

new pName[28];

new string[256];

AFK[playerid] = 0;

dcmd_afk(playerid,params[]) {

#pragma unused params //

if(AFK[playerid] == 0) {

GetPlayerName(playerid, pName, 28);

format(string, sizeof(string), "[ AFK ] %s (ID: %d) - Away From Keyboard", pName, playerid);

SendClientMessageToAll(COLOR_YELLOW, string);

TogglePlayerControllable(playerid, 0);

AFK[playerid] = 1; //

}else if(AFK[playerid] == 1) {

SendClientMessage(playerid,COLOR_YELLOW,"[ AFK ] Jíž jsi AFK");

}

return 1; // ukončení příkazu

}

dcmd(afk,3,cmdtext); //použití afk

if(AFK[playerid] > 0){ // jestliže je AFK větší jak 0

if(newkeys > -1 ){ // když hráč stiskne jakokoli definovanou klávesu

TogglePlayerControllable(playerid, 1); //

GetPlayerName(playerid, pName, 28); //Vezme jmeno a dá ho do pName

format(string, sizeof(string), "[ AFK ] %s (ID: %d) - Je zpátky", pName, playerid);

SendClientMessageToAll(COLOR_YELLOW, string);

AFK[playerid] = 0;

}

}

 

 

"help"

C:\DOCUME~1\GT4or\Plocha\GTA\SERVER\pawno\AFK.pwn(4) : error 017: undefined symbol "MAX_PLAYERS"

C:\DOCUME~1\GT4or\Plocha\GTA\SERVER\pawno\AFK.pwn(7) : error 010: invalid function or declaration

C:\DOCUME~1\GT4or\Plocha\GTA\SERVER\pawno\AFK.pwn(21) : error 010: invalid function or declaration

C:\DOCUME~1\GT4or\Plocha\GTA\SERVER\pawno\AFK.pwn(22) : error 010: invalid function or declaration

C:\DOCUME~1\GT4or\Plocha\GTA\SERVER\pawno\AFK.pwn(23) : error 010: invalid function or declaration

C:\DOCUME~1\GT4or\Plocha\GTA\SERVER\pawno\AFK.pwn(25) : warning 219: local variable "pName" shadows a variable at a preceding level

C:\DOCUME~1\GT4or\Plocha\GTA\SERVER\pawno\AFK.pwn(25) : error 010: invalid function or declaration

C:\DOCUME~1\GT4or\Plocha\GTA\SERVER\pawno\AFK.pwn(26) : warning 219: local variable "string" shadows a variable at a preceding level

C:\DOCUME~1\GT4or\Plocha\GTA\SERVER\pawno\AFK.pwn(26) : error 010: invalid function or declaration

C:\DOCUME~1\GT4or\Plocha\GTA\SERVER\pawno\AFK.pwn(26) : error 010: invalid function or declaration

C:\DOCUME~1\GT4or\Plocha\GTA\SERVER\pawno\AFK.pwn(28) : error 010: invalid function or declaration

C:\DOCUME~1\GT4or\Plocha\GTA\SERVER\pawno\AFK.pwn(31) : warning 203: symbol is never used: "dcmd_afk"

C:\DOCUME~1\GT4or\Plocha\GTA\SERVER\pawno\AFK.pwn(31) : warning 203: symbol is never used: "format"

C:\DOCUME~1\GT4or\Plocha\GTA\SERVER\pawno\AFK.pwn(31) : error 013: no entry point (no public functions)

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

 

 

10 Errors.

Link to comment
Share on other sites

  • 5 months later...

Čawte su tkový lamer ale háže errorky:

 

D:\Hry [Funkční]\GTA San Andreas\GTA San Andreas\pawno\include\dutils.inc(28) : warning 219: local variable "string" shadows a variable at a preceding level

D:\Hry [Funkční]\GTA San Andreas\GTA San Andreas\pawno\include\dutils.inc(132) : warning 219: local variable "string" shadows a variable at a preceding level

D:\Hry [Funkční]\GTA San Andreas\GTA San Andreas\pawno\include\dutils.inc(172) : warning 219: local variable "string" shadows a variable at a preceding level

D:\Hry [Funkční]\GTA San Andreas\GTA San Andreas\pawno\include\dutils.inc(267) : warning 219: local variable "string" shadows a variable at a preceding level

D:\Hry [Funkční]\GTA San Andreas\GTA San Andreas\pawno\include\dutils.inc(324) : warning 219: local variable "string" shadows a variable at a preceding level

D:\Hry [Funkční]\GTA San Andreas\GTA San Andreas\pawno\include\dutils.inc(366) : warning 219: local variable "string" shadows a variable at a preceding level

D:\Hry [Funkční]\GTA San Andreas\GTA San Andreas\pawno\include\dini.inc(239) : warning 219: local variable "string" shadows a variable at a preceding level

D:\HRY_FU~1\GTASAN~1\GTASAN~1\pawno\Untitled.pwn(13) : error 017: undefined symbol "strtoknew"

D:\HRY_FU~1\GTASAN~1\GTASAN~1\pawno\Untitled.pwn(102) : error 017: undefined symbol "AFK"

D:\HRY_FU~1\GTASAN~1\GTASAN~1\pawno\Untitled.pwn(102) : warning 215: expression has no effect

D:\HRY_FU~1\GTASAN~1\GTASAN~1\pawno\Untitled.pwn(102) : error 001: expected token: ";", but found "]"

D:\HRY_FU~1\GTASAN~1\GTASAN~1\pawno\Untitled.pwn(102) : error 029: invalid expression, assumed zero

D:\HRY_FU~1\GTASAN~1\GTASAN~1\pawno\Untitled.pwn(102) : fatal error 107: too many error messages on one line

 

 

 

Řádek: AFK[playerid] = 0;

Link to comment
Share on other sites

tak si to celé pekne zmaž, nauč sa robit podla tohoto tutu afk systém a potom si to všetko sprav vlastné, uvidíš že to pôjde bez errorov ;)

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...