Wysłany: 2012-05-24, 21:58
niree
Wiek: 28 Na forum: 5312 dni Posty: 22
Nick w MP: nireee_niree
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.
Wysłany: 2012-05-24, 22:02
ToxiC.
Wiek: 28 Na forum: 5246 dni Posty: 3792
Piwa : 8590
w podpisie mam skrypt na koguty, tam juz jest co? takiego , nie chce mi si? tu pisa? wi?c pobierz i zobacz
Wysłany: 2012-05-24, 22:10
niree
Wiek: 28 Na forum: 5312 dni Posty: 22
Nick w MP: nireee_niree
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.
Wysłany: 2012-05-24, 22:24
ToxiC.
Wiek: 28 Na forum: 5246 dni Posty: 3792
Piwa : 8590
O jej, wystarczy zobaczy? w OnDialogRepsonse..
na g?rze:
Pawn
new posiada [ MAX_PLAYERS ];
Pawn
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( posiada [ 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 );
posiada [ 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 );
posiada [ playerid ] = 0 ;
}
return 1 ;
}
Wysłany: 2012-05-24, 22:26
niree
Wiek: 28 Na forum: 5312 dni Posty: 22
Nick w MP: nireee_niree
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 , / 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 ;
}
(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 , / kogut , true ) == 0 )
Do us?yszenia.
Wysłany: 2012-05-25, 09:23
paskal
gtaoffline.pl
Wiek: 29 Na forum: 5643 dni Posty: 242
Piwa : 341
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[])
Wysłany: 2012-05-25, 15:04
niree
Wiek: 28 Na forum: 5312 dni Posty: 22
Nick w MP: nireee_niree
Oczywi?cie, nadal te same errory.
Wysłany: 2012-05-25, 19:10
Sillence
Wiek: 26 Na forum: 5157 dni Posty: 1514
Nick w MP: Sillence
Piwa : 1517
Zamie? linijk? 22221 na :
Kod: if(strcmp(cmdtext, "/kogut", true) == 0)
Brakowa?o po prostu:
Kod:
Wysłany: 2012-05-25, 19:12
paskal
gtaoffline.pl
Wiek: 29 Na forum: 5643 dni Posty: 242
Piwa : 341
A no tak tego nie zauwa?y?em
Wysłany: 2012-05-25, 19:32
niree
Wiek: 28 Na forum: 5312 dni Posty: 22
Nick w MP: nireee_niree
_FasteR_ , dzi?ki stary.
Piwosza dostajesz.
A tak btw. zapraszam do moich kolejnych problem?w/temat?w w tym dziale "pawno".
Pozdrawiam.
Tagi: funkcja :: koguta.
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: