Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2012-12-15, 23:48


Jendrula







Wiek: 31
Na forum: 5138 dni
Posty: 6
Nick w MP: John_Clemenzo



Respekt: 50

Witam postanowi?em zrobi? tak? komend? na serwer ale jest problem poniewa?
jak wpisz? /afk dobrze daje mi freeze pisz? pod nickiem AFK i na czacie ?e jestem teraz AFK ale gdy wpisz? drugi raz /afk to nie chc? mnie odmrozi? ani nic tylko ca?y czas powtarza to samo co powinno by? po wpisaniu pierwszy raz /afk

oto kod:
Kod:

if(strcmp(cmd, "/afk", true) == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_BIALY,"Jeste? Aktualnie AFK!");
TogglePlayerControllable(playerid,0);
SetPlayerChatBubble(playerid, "AFK", POMARANCZOWY_AFK, 20.0, 999999999);
}
else
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_BIALY,"Wr?ci?e? ,mo?esz dalej gra?!");
TogglePlayerControllable(playerid,1);
SetPlayerChatBubble(playerid, "", POMARANCZOWY_AFK, 20.0, 999999999);
}
}
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-16, 11:58


ToxiC.







Wiek: 28
Na forum: 5246 dni
Posty: 3792

Piwa: 8590

Respekt: 1143,8
Respekt: 1143,8

a mo?e troche inny sposob?
na g?rze:
Kod:

new AFK[MAX_PLAYERS];

OnPlayerConnect:
Kod:

AFK[playerid] = 0;

komenda:
Kod:


if(strcmp(cmd, "/afk", true) == 0)
{
if(!AFK[playerid])
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_BIALY,"Jeste? Aktualnie AFK!");
TogglePlayerControllable(playerid,0);
SetPlayerChatBubble(playerid, "AFK", POMARANCZOWY_AFK, 20.0, 999999999);
}
}
else if(AFK[playerid])
{
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_BIALY,"Wr?ci?e? ,mo?esz dalej gra?!");
TogglePlayerControllable(playerid,1);
SetPlayerChatBubble(playerid, "", POMARANCZOWY_AFK, 20.0, 999999999);
}
}
}
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-16, 13:28


Jendrula







Wiek: 31
Na forum: 5138 dni
Posty: 6
Nick w MP: John_Clemenzo



Respekt: 50

Nadal to samo :(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-16, 13:42


neroPL







Wiek: 28
Na forum: 5671 dni
Posty: 79
Nick w MP: Kapec

Piwa: 584

Respekt: 75,7

G?ra mapy :
Kod:

mafk[MAX_PLAYERS];


Connect :
Kod:

maffk[playerid]=0;

Kod:

if(strcmp(cmd, "/afk", true) == 0)
{
if(mafk[playerid] == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_BIALY,"Jeste? Aktualnie AFK!");
TogglePlayerControllable(playerid,0);
mafk[playerid] = 1;
SetPlayerChatBubble(playerid, "AFK", POMARANCZOWY_AFK, 20.0, 999999999);
}
}
else if(mafk[playerid] == 1)
{
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_BIALY,"Wr?ci?e? ,mo?esz dalej gra?!");
TogglePlayerControllable(playerid,1);
mafk[playerid] = 0;
SetPlayerChatBubble(playerid, "", POMARANCZOWY_AFK, 20.0, 999999999);
}
}
}
return 1;
}
i tyle :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-16, 14:02


Jendrula







Wiek: 31
Na forum: 5138 dni
Posty: 6
Nick w MP: John_Clemenzo



Respekt: 50

Kod:

G:\Chillout - Role Play v0.2.1\U-RP\ChillOut - Role Play\gamemodes\U-RP.pwn(41) : error 010: invalid function or declaration
G:\Chillout - Role Play v0.2.1\U-RP\ChillOut - Role Play\gamemodes\U-RP.pwn(2090) : error 017: undefined symbol "maffk"
G:\Chillout - Role Play v0.2.1\U-RP\ChillOut - Role Play\gamemodes\U-RP.pwn(2090) : warning 215: expression has no effect
G:\Chillout - Role Play v0.2.1\U-RP\ChillOut - Role Play\gamemodes\U-RP.pwn(2090) : error 001: expected token: ";", but found "]"
G:\Chillout - Role Play v0.2.1\U-RP\ChillOut - Role Play\gamemodes\U-RP.pwn(2090) : error 029: invalid expression, assumed zero
G:\Chillout - Role Play v0.2.1\U-RP\ChillOut - Role Play\gamemodes\U-RP.pwn(2090) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-16, 15:26


mishek







Wiek: 30
Na forum: 5272 dni
Posty: 33
Nick w MP: mishek

Piwa: 7

Respekt: 50

w connect:
Kod:

mafk[playerid] = 0;

zamiast:
Kod:

maffk[playerid] = 0;

bo na g?rze masz zdeklarowane
Kod:

new mafk[MAX_PLAYERS];


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-16, 16:44


Jendrula







Wiek: 31
Na forum: 5138 dni
Posty: 6
Nick w MP: John_Clemenzo



Respekt: 50

Dzi?ki wam bardzo ka?dy otrzyma? po piwku zimniutkim

Postaw piwo autorowi tego posta
 

 
Tagi: nie :: dziala :: poprawnie :: komenda
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN » [GF] nie dziala poprawnie komenda Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku