Pomoc oko pomicne ograde

Započeo Burnout, Maj 19, 2009, 20:30:50 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Stavio sam prema nekom tutorialu koji sam nasao.
Ovako mi izgleda kod:


...
new Float:ChangePos[MAX_PLAYERS][3];
new ChangePos2[MAX_PLAYERS][2];
new Float:PlayerPos[MAX_PLAYERS][6];
new Float:TeleportDest[MAX_PLAYERS][3];
new Float:TelePos[MAX_PLAYERS][6];
new vrata;


...


...
//------------------------------------------------------------------------------------------------------
public OnGameModeInit()
{
    // CreateObject
{
CreateObject(971, 2460.443359, -1658.687378, 16.874605, 0.0000, 0.0000, 270.8595);
    vrata = CreateObject(971, 2460.443359, -1658.687378, 16.874605, 0.0000, 0.0000, 270.8595);
}
new string[MAX_PLAYER_NAME];
    new string1[MAX_PLAYER_NAME];
for(new c=0;c<CAR_AMOUNT;c++)
...



...
//---------------------------<[ OnPlayerCommandText ]>--------------------------------------------------------

public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
new playermoney;
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new playername[MAX_PLAYER_NAME];
new cmd[256];
new tmp[256];
new giveplayerid, moneys, idx;
cmd = strtok(cmdtext, idx);

//__________________________________________________________KOMANDE______________________________
/*
if (strcmp(cmdtext, "/otvori", true)==0)
{
if(PlayerInfo[playerid][pLeader] == 8 || PlayerInfo[playerid][pMember] == 8)
{
    MoveObject(vrata, 2450, -1658.687378, 16.874605, 8.0);
SendClientMessage(playerid, COLOR_GREEN, "Otvorili ste vrata test baze");
}
else return SendClientMessage(playerid, COLOR_GREEN, "Nisi clan test baze.");
}
return 1;
}
if(strcmp(cmd,"/zatvori",true)==0)
{
    if(PlayerInfo[playerid][pMember] == 8||PlayerInfo[playerid][pLeader] == 8)
    {
MoveObject(vrata, 2460, -1658.687378, 16.874605, 15.0);

SendClientMessage(playerid, COLOR_GREEN, "Zatvorili ste vrata test baze.");
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "Nisi clan baze.");
}
return 1;
}
//-------------------------------[Pay]--------------------------------------------------------------------------
if(strcmp(cmd, "/pay", true) == 0)
...


Prije mi je sam pawno crashao kad sam pokrenuo compiler, onda sam nekaj zmrdao da ne crasha, ali kad pokrenem server, udem u igru ali nemogu /login, niti ikakvu komandu.  :'(
Poslednja Izmena: Maj 20, 2009, 15:53:27 POSLE PODNE od zerocoolos

new Test;

Test = CreateObject(969, 1443.2604, 663.2594, 9.8388, 0.0000, 0.0000, 0.0000); //test

//-------------------Kapija---------------------------
if(strcmp(cmd,"/testo",true)==0)
{
    if(PlayerInfo[playerid][pMember] == 5||PlayerInfo[playerid][pLeader] == 5)
    {
MoveObject(Test, 1532.2976, 663.1336, 9.8395,7.000);
SendClientMessage(playerid, COLOR_GREEN, "Otvarate vrata TEST Baze.");
}
else
{
SendClientMessage(playerid, COLOR_RED, "Nisi Clan Obitelji TEST.");
}
return 1;
}
if(strcmp(cmd,"/testc",true)==0)
{
    if(PlayerInfo[playerid][pMember] == 5||PlayerInfo[playerid][pLeader] == 5)
    {
MoveObject(Test, 1523.4078, 663.1533, 9.8388,7.000);

SendClientMessage(playerid, COLOR_GREEN, "Zatvarate vrata TEST Baze.");
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "Nisi Clan Obitelji TEST.");
}
return 1;
}






Citat: scootzzZz poslato Maj 19, 2009, 20:43:48 POSLE PODNE
new Test;

Test = CreateObject(969, 1443.2604, 663.2594, 9.8388, 0.0000, 0.0000, 0.0000); //test

//-------------------Kapija---------------------------
if(strcmp(cmd,"/testo",true)==0)
{
    if(PlayerInfo[playerid][pMember] == 5||PlayerInfo[playerid][pLeader] == 5)
    {
MoveObject(Test, 1532.2976, 663.1336, 9.8395,7.000);
SendClientMessage(playerid, COLOR_GREEN, "Otvarate vrata TEST Baze.");
}
else
{
SendClientMessage(playerid, COLOR_RED, "Nisi Clan Obitelji TEST.");
}
return 1;
}
if(strcmp(cmd,"/testc",true)==0)
{
    if(PlayerInfo[playerid][pMember] == 5||PlayerInfo[playerid][pLeader] == 5)
    {
MoveObject(Test, 1523.4078, 663.1533, 9.8388,7.000);

SendClientMessage(playerid, COLOR_GREEN, "Zatvarate vrata TEST Baze.");
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "Nisi Clan Obitelji TEST.");
}
return 1;
}







Tako je scootzzz. Ja ne znam sta je on gore izvodio u onome kodu ali ovaj radi 100%.

funky

negdje je obrisao " } ili { " i to ga muci...meni je znao biti problem da mi se server crasha zbog ovog...

tamo kod kucanja /help komande


SendClientMessage(playerid,COLOR_PRIMJER , "");

tako da probaj to maknit ako slucajno imas  ;)

a moze ti bit niz drugih stvari koje si slucajno obrisao radeci nesto...uglavnom zapamti da poslije svake stavke koju uradis napravis backup i onda si miran  ;)

JoeBullet

ovdje ti je greska

// CreateObject
{
CreateObject(971, 2460.443359, -1658.687378, 16.874605, 0.0000, 0.0000, 270.8595);
    vrata = CreateObject(971, 2460.443359, -1658.687378, 16.874605, 0.0000, 0.0000, 270.8595);
}

stavio si { i } gdje ne treba.. i btw sta svi radite istu pogresku tj. prvo stavite normalan object a onda ga assignate varijabli ,to je krivo  zato jer ovaj prvi ne treba.. jer kad se assigna varijabli isto ce se napraviti

Haha da, nisam ni gledao, 2 puta stavljaju bezveze. Dovoljno je samo staviti vrata=CreateObject....