Wysłany: 2012-02-11, 01:25
eras800
Wiek: 31 Na forum: 5767 dni Posty: 30
Nick w MP: Jobas
Piwa : 1049
Witam potrzebuje pomocy jak mam do tego kodu doda? nicki aby tylko one mog?y otwiera? bramy?
Kod: #include <a_samp>
#pragma tabsize 0
new brama ;
public OnGameModeInit()
{
brama = CreateObject(980, 2906.66, 2400.20, 12.14, 0.00, 0.00, 0.00);
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/brama.close", true)==0){
{
GameTextForPlayer(playerid, "~n~Brama3 ~r~Zamknieta", 2500, 5);
MoveObject(brama, 1206.66, 2400.20, 12.14, 3);
}
return 1;
}
if (strcmp(cmdtext, "/brama.open", true)==0){
{
GameTextForPlayer(playerid, "n~Brama3 ~g~Otwrata", 2500, 5);
MoveObject(brama, 2896.45, 2400.16, 12.35, 3);
}
return 1;
}
return 0;
}
Wysłany: 2012-02-11, 11:26
xxmikel611xx
~!@#$%^!
Wiek: 30 Na forum: 5812 dni Posty: 163
Nick w MP: Mikel__xD
Piwa : 159
A ja mam takie pytanie czy dzia?a ci to MoveObject
Wysłany: 2012-02-11, 13:18
MG303
Wiek: 30 Na forum: 6418 dni Posty: 654
Piwa : 2990
xxmikel611xx , w 0.3d b?dzie to tak:
Kod: MoveObject(brama, 2896.45, 2400.16, 12.35, 3, 0.0, 0.0, 0.0);
eras800 ,
robisz co? takiego:
Kod: if (strcmp(cmdtext, "/brama.close", true)==0){
{
if (!strcmp(PlayerName(playerid), "NICK1", true) || !strcmp(PlayerName(playerid), "NICK2", true) || !strcmp(PlayerName(playerid), "NICK3", true)){
GameTextForPlayer(playerid, "~n~Brama3 ~r~Zamknieta", 2500, 5);
MoveObject(brama, 1206.66, 2400.20, 12.14, 3);
}
}
return 1;
}
Wysłany: 2012-02-11, 17:06
xxmikel611xx
~!@#$%^!
Wiek: 30 Na forum: 5812 dni Posty: 163
Nick w MP: Mikel__xD
Piwa : 159
Mattwell , ja wiem co to jest MoveObject tylko pytam czy dzia?a bo ja robi? wind? no to jako? nic si? nie dzieje.
Wysłany: 2012-02-11, 18:34
eras800
Wiek: 31 Na forum: 5767 dni Posty: 30
Nick w MP: Jobas
Piwa : 1049
Zrobi?em tak
Kod: #include <a_samp>
#pragma tabsize 0
new brama ;
public OnGameModeInit()
{
brama = CreateObject(980, 2906.66, 2400.20, 12.14, 0.00, 0.00, 0.00);
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/brama.close", true)==0){
{
if (!strcmp(PlayerName(playerid), "NICK1", true) || !strcmp(PlayerName(playerid), "NICK2", true) || !strcmp(PlayerName(playerid), "NICK3", true)){
GameTextForPlayer(playerid, "~n~Brama3 ~r~Zamknieta", 2500, 5);
MoveObject(brama, 1206.66, 2400.20, 12.14, 3);
}
}
return 1;
}
if (strcmp(cmdtext, "/brama.open", true)==0){
{
GameTextForPlayer(playerid, "n~Brama3 ~g~Otwrata", 2500, 5);
MoveObject(brama, 2896.45, 2400.16, 12.35, 3);
}
return 1;
}
return 0;
}
a mam taki error
Kod: C:\Users\Komputer\Desktop\bramy.pwn(14) : error 017: undefined symbol "PlayerName"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
A po dodaniu new PlayerName;
Kod: C:\Users\Komputer\Desktop\bramy.pwn(15) : error 012: invalid function call, not a valid address
C:\Users\Komputer\Desktop\bramy.pwn(15) : warning 215: expression has no effect
C:\Users\Komputer\Desktop\bramy.pwn(15) : error 001: expected token: ";", but found ")"
C:\Users\Komputer\Desktop\bramy.pwn(15) : error 029: invalid expression, assumed zero
C:\Users\Komputer\Desktop\bramy.pwn(15) : 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.
Wysłany: 2012-02-12, 10:36
optimus
PawnoMen
Wiek: 27 Na forum: 5614 dni Posty: 453
Nick w MP: [PMS]ReveresPL
Piwa : 159
Na pocz?tku piszesz:
Cytat: new Player[MAX_PLAYER_NAME];
Potem tam gdzie masz komende:
Cytat: GetPlayerName(playerid, Player, sizeof(Player));
Pami?taj je?eli chcesz gdzie? definiowa? nazwe gracza to musisz ko?o tej funcji (w callbacku) przynajmniej raz:
Cytat: GetPlayerName(playerid, Player, sizeof(Player));
Aby pobra?o nazwe gracza !
Pomog?em ? postaw
[ Dodano : 2012-02-12, 10:37 ]
A i jeszcze czy na ko?cu gdzie jest return 0; nie powinno by? return 1; ??
Wysłany: 2012-02-13, 01:40
eras800
Wiek: 31 Na forum: 5767 dni Posty: 30
Nick w MP: Jobas
Piwa : 1049
mo?esz to odrazu zrobi?? Dam piwko.
Wysłany: 2012-02-13, 11:39
Mlody951
Wiek: 28 Na forum: 5229 dni Posty: 7
Nick w MP: Mlody
Piwa : 2
Kod: #include <a_samp>
#pragma tabsize 0
new brama;
public OnFilterScriptInit()
{
brama = CreateObject(980, 2906.66, 2400.20, 12.14, 0.00, 0.00, 0.00);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/brama.close", true)==0)
{
if (!strcmp(PlayerName(playerid), "NICK1", true) || !strcmp(PlayerName(playerid), "NICK2", true) || !strcmp(PlayerName(playerid), "NICK3", true))
{
GameTextForPlayer(playerid, "~n~Brama3 ~r~Zamknieta", 2500, 5);
MoveObject(brama, 1206.66, 2400.20, 12.14, 3);
}
return 1;
}
if (strcmp(cmdtext, "/brama.open", true)==0)
{
if (!strcmp(PlayerName(playerid), "NICK1", true) || !strcmp(PlayerName(playerid), "NICK2", true) || !strcmp(PlayerName(playerid), "NICK3", true))
{
GameTextForPlayer(playerid, "n~Brama3 ~g~Otwrata", 2500, 5);
MoveObject(brama, 2896.45, 2400.16, 12.35, 3);
}
return 1;
}
return 0;
}
stock PlayerName(playerid)
{
new name[24];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
}
Tagi: otwieranie :: bram :: kilka :: nicków.
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: