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

Wysłany: 2012-05-24, 21:58


niree







Wiek: 28
Na forum: 5312 dni
Posty: 22
Nick w MP: nireee_niree



Respekt: 50

Witam, mam ma?y problem z kogutem(syren? PD).

Mianowicie mam taki skrypt :

Cytat:

//-------------------kogut-----------------

if(strcmp(cmdtext, "/kogut", true) == 0)
{
if(IsACop(playerid) || IsAHA(playerid))
{
if(PlayerInfo[playerid][pRank] < 2)
{
SendClientMessage(playerid, COLOR_GREY, " Musisz mie? 2 range aby u?ywa? koguta/nie jeste? policjantem!");
return 1;
}
if (GetPlayerState(playerid)!=PLAYER_STATE_DRIVER)
{
return SendClientMessage(playerid, COLOR_GRAD1, "Nie jeste? Kierowc?/w poje?dzie.");
}
kogut[playerid] = CreateObject(18646, 0.0,0.0,0.0,0.0,0.0,0.0, 250.0);
AttachObjectToVehicle(kogut[playerid], GetPlayerVehicleID(playerid), 0.0, 0.0, 0.9, 0.0, 0.0, 1.5);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s przyczepia kogut na dach samochodu.", sendername);
SendClientMessage(playerid, COLOR_REDD, "OSTRZE?ENIE: Nadmierne Spamowanie Komend? /kogut grozi wydaleniem z frakcji!!");
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
return 1;
}

if(strcmp(cmdtext, "/zkogut", true) == 0)
{
if(IsACop(playerid) || IsAHA(playerid))
{
if(PlayerInfo[playerid][pRank] < 2)
{
SendClientMessage(playerid, COLOR_GREY, " Musisz mie? 2 range/nie jeste? policjantem!");
return 1;
}
if (GetPlayerState(playerid)!=PLAYER_STATE_DRIVER)
{
return SendClientMessage(playerid, COLOR_GRAD1, "Nie jeste? Kierowc?/w Poje?dzie.");
}
DestroyObject(kogut[playerid]);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s zdejmuje kogut z dachu samochodu.", sendername);
SendClientMessage(playerid, COLOR_REDD, "OSTRZE?ENIE: Nadmierne Spamowanie Komend? /kogut grozi wydaleniem z frakcji!!");
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
return 1;
}


I chcia?bym zrobic, ?e po wpisaniu /kogut drugi raz, to nie, ?eby drugi kogut sie tworzy?...tylko, ?eby wyskoczy?o "masz ju? za?o?onego koguta ! wpisz /zkogut".
Tak samo w Drugim, nie chce, aby /zkogut dzia?a? gdy kogut jest wy??czony.

Mam nadziej?, ?e mnie zrozumieli?cie.

Pozdrawiam.

@Je?eli mo?na, to prosz? r?wnie? o zrobienie mi /kogut - uruchamia koguta, ponowne wpisanie /kogut - wy??cza koguta.

Pozdrawiam.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-05-24, 22:02


ToxiC.







Wiek: 28
Na forum: 5246 dni
Posty: 3792

Piwa: 8590

Respekt: 1143,8
Respekt: 1143,8

w podpisie mam skrypt na koguty, tam juz jest co? takiego , nie chce mi si? tu pisa? wi?c pobierz i zobacz :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-05-24, 22:10


niree







Wiek: 28
Na forum: 5312 dni
Posty: 22
Nick w MP: nireee_niree



Respekt: 50

Ehhh, troszke nie halo, gdy? tw?j skrypt jest na poziomie GUI z komend?, kt?ra uruchamia gui, a ja chc? zwyk?? komend?, dodaj?c? i usuwaj?c? koguta.

Nie chce bawi? sie w GUI, poniewa? jak jest jaka? akcja, to kto b?dzie bawi? si? w GUI i minute zak?ada? koguta :-)

Wi?c prosz? o zrobienie dla mnie tej funkcji.

Pozdrawiam.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-05-24, 22:24


ToxiC.







Wiek: 28
Na forum: 5246 dni
Posty: 3792

Piwa: 8590

Respekt: 1143,8
Respekt: 1143,8

O jej, wystarczy zobaczy? w OnDialogRepsonse..

na g?rze:
Pawn

new posiada[MAX_PLAYERS];



Pawn

if(strcmp(cmdtext, /koguttrue) == 0)
{
if(IsACop(playerid) || IsAHA(playerid))
{
if(PlayerInfo[playerid][pRank] < 2)
{
SendClientMessage(playeridCOLOR_GREYMusisz mie2 range aby u?ywakoguta/nie jestepolicjantem!);
return 1;
}
if (GetPlayerState(playerid)!=PLAYER_STATE_DRIVER)
{
return SendClientMessage(playeridCOLOR_GRAD1Nie jesteKierowc?/w poje?dzie.);
}
if(posiada[playerid] == 0)
{
kogut[playerid] = CreateObject(186460.0,0.0,0.0,0.0,0.0,0.0250.0);
AttachObjectToVehicle(kogut[playerid], GetPlayerVehicleID(playerid), 0.00.00.90.00.01.5);
posiada[playerid] = 1;
GetPlayerName(playeridsendernamesizeof(sendername));
format(stringsizeof(string), %s przyczepia kogut na dach samochodu., sendername);
}
else
{
SendClientMessage(playerid, -1"{00CED1}Masz ju? za?o?ony Kogut");
}
SendClientMessage(playeridCOLOR_REDDOSTRZE?ENIENadmierne Spamowanie Komend? /kogut grozi wydaleniem z frakcji!!);
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
return 1;
}

if(strcmp(cmdtext, /zkoguttrue) == 0)
{
if(IsACop(playerid) || IsAHA(playerid))
{
if(PlayerInfo[playerid][pRank] < 2)
{
SendClientMessage(playeridCOLOR_GREYMusisz mie2 range/nie jestepolicjantem!);
return 1;
}
if (GetPlayerState(playerid)!=PLAYER_STATE_DRIVER)
{
return SendClientMessage(playeridCOLOR_GRAD1Nie jesteKierowc?/w Poje?dzie.);
}
DestroyObject(kogut[playerid]);
GetPlayerName(playeridsendernamesizeof(sendername));
format(stringsizeof(string), %s zdejmuje kogut z dachu samochodu., sendername);
SendClientMessage(playeridCOLOR_REDDOSTRZE?ENIENadmierne Spamowanie Komend? /kogut grozi wydaleniem z frakcji!!);
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
posiada[playerid] = 0;
}
return 1;
}



Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-05-24, 22:26


niree







Wiek: 28
Na forum: 5312 dni
Posty: 22
Nick w MP: nireee_niree



Respekt: 50

A ten...

Pom?g?by? z t? komend? /kogut ?
-Pierwszy raz sie wpisze, to pojawia sie, i wyskakuje na czacie to co wyskakiwa?o.
-Ale jak si? drugi raz wpisze to kogut znika i te? wyskakuje to co na czacie mia?o wyskoczy? po komendzie /zkogut.

[ Dodano: 2012-05-24, 22:40 ]
No wi?c tak,

Doda?em na sam? g?r? mapy :

Pawn
new posiada[MAX_PLAYERS];
new kogut[MAX_PLAYERS];


Potem gdzie? tam....

Doda?em :

Pawn
if(strcmp(cmdtext, /koguttrue) == 0)
{
if(IsACop(playerid) || IsAHA(playerid))
{
if(PlayerInfo[playerid][pRank] < 2)
{
SendClientMessage(playeridCOLOR_GREYMusisz mie2 range aby u?ywakoguta/nie jestepolicjantem!);
return 1;
}
if (GetPlayerState(playerid)!=PLAYER_STATE_DRIVER)
{
return SendClientMessage(playeridCOLOR_GRAD1Nie jesteKierowc?/w poje?dzie.);
}
if(posiadaxd[playerid] == 0)
{
kogut[playerid] = CreateObject(186460.0,0.0,0.0,0.0,0.0,0.0250.0);
AttachObjectToVehicle(kogut[playerid], GetPlayerVehicleID(playerid), 0.00.00.90.00.01.5);
posiadaxd[playerid] = 1;
GetPlayerName(playeridsendernamesizeof(sendername));
format(stringsizeof(string), %s przyczepia kogut na dach samochodu., sendername);
}
else
{
SendClientMessage(playerid, -1"{00CED1}Masz ju? za?o?ony Kogut");
}
SendClientMessage(playeridCOLOR_REDDOSTRZE?ENIENadmierne Spamowanie Komend? /kogut grozi wydaleniem z frakcji!!);
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
return 1;
}

if(strcmp(cmdtext, /zkoguttrue) == 0)
{
if(IsACop(playerid) || IsAHA(playerid))
{
if(PlayerInfo[playerid][pRank] < 2)
{
SendClientMessage(playeridCOLOR_GREYMusisz mie2 range/nie jestepolicjantem!);
return 1;
}
if (GetPlayerState(playerid)!=PLAYER_STATE_DRIVER)
{
return SendClientMessage(playeridCOLOR_GRAD1Nie jesteKierowc?/w Poje?dzie.);
}
DestroyObject(kogut[playerid]);
GetPlayerName(playeridsendernamesizeof(sendername));
format(stringsizeof(string), %s zdejmuje kogut z dachu samochodu., sendername);
SendClientMessage(playeridCOLOR_REDDOSTRZE?ENIENadmierne Spamowanie Komend? /kogut grozi wydaleniem z frakcji!!);
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
posiadaxd[playerid] = 0;
}
return 1;
}


(posiadaxd = posiada, poniewa? funkcje posiada[...] mam ju?.)

Errory po skompilowaniu :

Kod:

C:\Users\N!ree\Desktop\app\Pawno+Include\b-rp.pwn(22221) : error 029: invalid expression, assumed zero
C:\Users\N!ree\Desktop\app\Pawno+Include\b-rp.pwn(22221) : warning 215: expression has no effect
C:\Users\N!ree\Desktop\app\Pawno+Include\b-rp.pwn(22221) : warning 215: expression has no effect
C:\Users\N!ree\Desktop\app\Pawno+Include\b-rp.pwn(22221) : error 001: expected token: ";", but found ")"
C:\Users\N!ree\Desktop\app\Pawno+Include\b-rp.pwn(22221) : error 029: invalid expression, assumed zero
C:\Users\N!ree\Desktop\app\Pawno+Include\b-rp.pwn(22221) : fatal error 107: too many error messages on one line

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


4 Errors.


Linijka 22221:

Pawn
if(strcmp(cmdtext, /koguttrue) == 0)


Do us?yszenia.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-05-25, 09:23


paskal

gtaoffline.pl






Wiek: 29
Na forum: 5644 dni
Posty: 242

Piwa: 341

Respekt: 126,6
Respekt: 126,6

Ostrzeżeń: 20%
Kod:

if(strcmp(cmdtext, /kogut, true) == 0)
{
if(IsACop(playerid) || IsAHA(playerid))
{
if(PlayerInfo[playerid][pRank] < 2)
{
SendClientMessage(playerid, COLOR_GREY, Musisz mie? 2 range aby u?ywa? koguta/nie jeste? policjantem!);
return 1;
}
if (GetPlayerState(playerid)!=PLAYER_STATE_DRIVER)
{
return SendClientMessage(playerid, COLOR_GRAD1, Nie jeste? Kierowc?/w poje?dzie.);
}
if(posiadaxd[playerid] == 0)
{
kogut[playerid] = CreateObject(18646, 0.0,0.0,0.0,0.0,0.0,0.0, 250.0);
AttachObjectToVehicle(kogut[playerid], GetPlayerVehicleID(playerid), 0.0, 0.0, 0.9, 0.0, 0.0, 1.5);
posiadaxd[playerid] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), %s przyczepia kogut na dach samochodu., sendername);
}
else
{
SendClientMessage(playerid, -1, "{00CED1}Masz ju? za?o?ony Kogut");
}
SendClientMessage(playerid, COLOR_REDD, OSTRZE?ENIE: Nadmierne Spamowanie Komend? /kogut grozi wydaleniem z frakcji!!);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
return 1;
}

if(strcmp(cmdtext, /zkogut, true) == 0)
{
if(IsACop(playerid) || IsAHA(playerid))
{
if(PlayerInfo[playerid][pRank] < 2)
{
SendClientMessage(playerid, COLOR_GREY, Musisz mie? 2 range/nie jeste? policjantem!);
return 1;
}
if (GetPlayerState(playerid)!=PLAYER_STATE_DRIVER)
{
return SendClientMessage(playerid, COLOR_GRAD1, Nie jeste? Kierowc?/w Poje?dzie.);
}
DestroyObject(kogut[playerid]);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), %s zdejmuje kogut z dachu samochodu., sendername);
SendClientMessage(playerid, COLOR_REDD, OSTRZE?ENIE: Nadmierne Spamowanie Komend? /kogut grozi wydaleniem z frakcji!!);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
posiadaxd[playerid] = 0;
}
return 1;
}


Da?e? t? komend? do:

Kod:

public OnPlayerCommandText(playerid, cmdtext[])


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-05-25, 15:04


niree







Wiek: 28
Na forum: 5312 dni
Posty: 22
Nick w MP: nireee_niree



Respekt: 50

Oczywi?cie, nadal te same errory.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-05-25, 19:10


Sillence







Wiek: 26
Na forum: 5157 dni
Posty: 1514
Nick w MP: Sillence

Piwa: 1517

Respekt: 416,3
Respekt: 416,3

Zamie? linijk? 22221 na :
Kod:

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


Brakowa?o po prostu:
Kod:

"


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-05-25, 19:12


paskal

gtaoffline.pl






Wiek: 29
Na forum: 5644 dni
Posty: 242

Piwa: 341

Respekt: 126,6
Respekt: 126,6

Ostrzeżeń: 20%
A no tak tego nie zauwa?y?em :D

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-05-25, 19:32


niree







Wiek: 28
Na forum: 5312 dni
Posty: 22
Nick w MP: nireee_niree



Respekt: 50

_FasteR_ , dzi?ki stary.

Piwosza dostajesz.

A tak btw. zapraszam do moich kolejnych problem?w/temat?w w tym dziale "pawno".

Pozdrawiam.

Postaw piwo autorowi tego posta
 

 
Tagi: funkcja :: koguta.
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN » [INNE] Funkcja Koguta. 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