U vezi komandi...

Započeo Reza, April 09, 2010, 16:58:07 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Evo ovako idem na new i onda imam ovo

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
  // Do something here
return 1;
}
return 0;
}


nznam kako cu stavit neku komandu idem kopirati iz gf moda i onda mi izadje 17 errora
pls pomozite...

pokosa sam po nekim tutorijalima sto sam nasao odi ali uvik isto..

Hvala.


Kliknite-->registrirajte se i zaradite 
http://www.neobux.com/?r=neoreza

Citat: ...:::---REZA---:::... poslato April 09, 2010, 16:58:07 POSLE PODNE
Evo ovako idem na new i onda imam ovo

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
  // Do something here
return 1;
}
return 0;
}


nznam kako cu stavit neku komandu idem kopirati iz gf moda i onda mi izadje 17 errora
pls pomozite...

pokosa sam po nekim tutorijalima sto sam nasao odi ali uvik isto..

Hvala.


public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/pozdrav", cmdtext, true, 10) == 0) //ovo di pise "/pozdrav" to je tvoja komanda mozes stavit sta god oces...
{
                SendClientMessageToAll(0x0088FFAA, "Pozdravljam vas svih !");// ovo SendClientMessageToAll to je funkcija da posalje poruku koju zelis svim igracima na serveru, ovo "0x0088FFAA" to je boja(u ovom slucaju plava), "pozdravljam vas svih" to je poruka tu isto mozes stavit sta god oces....
return 1;
}
return 0;
}

iYoko

CITAJ OSNOVE!!! I NE POSTAVLJAJ OVAKVA PITANJ VISE

hvala puno a jel mi mos pokazat kako to napravit za komandu /veh i znas sve sta ide uz nju...

i hvala jos jednom.  :)


Kliknite-->registrirajte se i zaradite 
http://www.neobux.com/?r=neoreza

Eo ti i vise ne postavljaj ovako glupa pitanja...

if(strcmp(cmd, "/veh", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if (PlayerInfo[playerid][pAdmin] < 4)
{
    SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
    return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
new car;
car = strval(tmp);
if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, "   Vehicle Number can't be below 400 or above 611 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Color Number can't be below 0 or above 126 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
new color2;
color2 = strval(tmp);
if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Color Number can't be below 0 or above 126 !"); return 1; }
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new carid = CreateVehicle(car, X,Y,Z, 0.0, color1, color2, 60000);
CreatedCars[CreatedCar] = carid;
CreatedCar ++;
format(string, sizeof(string), "   Vehicle %d spawned.", carid);
SendClientMessage(playerid, COLOR_GREY, string);
}
return 1;
}

evo kad napravim ovo
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/veh", cmdtext, true, 10) == 0)
{
           if(IsPlayerConnected(playerid))
   {
       if (PlayerInfo[playerid][pAdmin] < 4)
{
   SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
   return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
new car;
car = strval(tmp);
if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, "   Vehicle Number can't be below 400 or above 611 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Color Number can't be below 0 or above 126 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
new color2;
color2 = strval(tmp);
if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Color Number can't be below 0 or above 126 !"); return 1; }
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new carid = CreateVehicle(car, X,Y,Z, 0.0, color1, color2, 60000);
CreatedCars[CreatedCar] = carid;
CreatedCar ++;
format(string, sizeof(string), "   Vehicle %d spawned.", carid);
SendClientMessage(playerid, COLOR_GREY, string);
}
return 1;
}


izadje mi ovo

C:\Users\biljana\Desktop\Test_Server\gamemodes\marinaGM.pwn(180) : error 017: undefined symbol "PlayerInfo"
C:\Users\biljana\Desktop\Test_Server\gamemodes\marinaGM.pwn(180) : warning 215: expression has no effect
C:\Users\biljana\Desktop\Test_Server\gamemodes\marinaGM.pwn(180) : error 001: expected token: ";", but found "]"
C:\Users\biljana\Desktop\Test_Server\gamemodes\marinaGM.pwn(180) : error 029: invalid expression, assumed zero
C:\Users\biljana\Desktop\Test_Server\gamemodes\marinaGM.pwn(180) : 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.



a kad napravim tocno tako kako si rekao izadje ovo

C:\Users\biljana\Desktop\Test_Server\gamemodes\marinaGM.pwn(176) : error 017: undefined symbol "cmd"
C:\Users\biljana\Desktop\Test_Server\gamemodes\marinaGM.pwn(180) : error 017: undefined symbol "PlayerInfo"
C:\Users\biljana\Desktop\Test_Server\gamemodes\marinaGM.pwn(180) : warning 215: expression has no effect
C:\Users\biljana\Desktop\Test_Server\gamemodes\marinaGM.pwn(180) : error 001: expected token: ";", but found "]"
C:\Users\biljana\Desktop\Test_Server\gamemodes\marinaGM.pwn(180) : error 029: invalid expression, assumed zero
C:\Users\biljana\Desktop\Test_Server\gamemodes\marinaGM.pwn(180) : 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.



mozda jesu glupa pitanja al nerazumin koji ku*ac je ovo??

Hvala
Poslednja Izmena: April 09, 2010, 18:04:50 POSLE PODNE od dinkO14


Kliknite-->registrirajte se i zaradite 
http://www.neobux.com/?r=neoreza

Editiro sam ti post.Ubuduce i erore stavljaj u "code" jer je onako nepregledno.

ok dinkO14 jel znas kako cu ovo rjesit ??


Kliknite-->registrirajte se i zaradite 
http://www.neobux.com/?r=neoreza


evo, kod mene su isti erori pa predpostavljam da je ista linija:

if (PlayerInfo [playerid][pAdmin] < 4)

Evo sliku



Pomagajteee....

Hvala.



Kliknite-->registrirajte se i zaradite 
http://www.neobux.com/?r=neoreza

nastoe

Citat: ...:::---REZA---:::... poslato April 09, 2010, 17:56:26 POSLE PODNE
evo kad napravim ovo
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/veh", cmdtext, true, 10) == 0)
{
           if(IsPlayerConnected(playerid))
   {
       if (PlayerInfo[playerid][pAdmin] < 4)
{
   SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
   return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
new car;
car = strval(tmp);
if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, "   Vehicle Number can't be below 400 or above 611 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Color Number can't be below 0 or above 126 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
new color2;
color2 = strval(tmp);
if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Color Number can't be below 0 or above 126 !"); return 1; }
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new carid = CreateVehicle(car, X,Y,Z, 0.0, color1, color2, 60000);
CreatedCars[CreatedCar] = carid;
CreatedCar ++;
format(string, sizeof(string), "   Vehicle %d spawned.", carid);
SendClientMessage(playerid, COLOR_GREY, string);
}
return 1;
}


izadje mi ovo

C:\Users\biljana\Desktop\Test_Server\gamemodes\marinaGM.pwn(180) : error 017: undefined symbol "PlayerInfo"
C:\Users\biljana\Desktop\Test_Server\gamemodes\marinaGM.pwn(180) : warning 215: expression has no effect
C:\Users\biljana\Desktop\Test_Server\gamemodes\marinaGM.pwn(180) : error 001: expected token: ";", but found "]"
C:\Users\biljana\Desktop\Test_Server\gamemodes\marinaGM.pwn(180) : error 029: invalid expression, assumed zero
C:\Users\biljana\Desktop\Test_Server\gamemodes\marinaGM.pwn(180) : 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.



a kad napravim tocno tako kako si rekao izadje ovo

C:\Users\biljana\Desktop\Test_Server\gamemodes\marinaGM.pwn(176) : error 017: undefined symbol "cmd"
C:\Users\biljana\Desktop\Test_Server\gamemodes\marinaGM.pwn(180) : error 017: undefined symbol "PlayerInfo"
C:\Users\biljana\Desktop\Test_Server\gamemodes\marinaGM.pwn(180) : warning 215: expression has no effect
C:\Users\biljana\Desktop\Test_Server\gamemodes\marinaGM.pwn(180) : error 001: expected token: ";", but found "]"
C:\Users\biljana\Desktop\Test_Server\gamemodes\marinaGM.pwn(180) : error 029: invalid expression, assumed zero
C:\Users\biljana\Desktop\Test_Server\gamemodes\marinaGM.pwn(180) : 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.



mozda jesu glupa pitanja al nerazumin koji ku*ac je ovo??

Hvala

Normalno da dobijes to kada nemas u modu !!!NISTAA!!! To znaci nemas Strok niti PlayerInfo moras SVEEEEEE definirati..... SVE a ti nemas nista to je ko da ides raditi ficeka i samo mu stavis motor od BMW-a moras jos puno drugis stvari staviti uz motor...Tako i ovdje...

aj pls ucini mi uslugu bit cu ti vrlooo zahvalan..

pls stavi mi sta sve triban dodat u skriptu...

da bi moglo sve normalno funkcionirat.

Hvala brate.


Kliknite-->registrirajte se i zaradite 
http://www.neobux.com/?r=neoreza

pocni ureÄ'ivati gf mod ili pen1,a ne odma pravis novi mod i zaspamas cijeli forum s temama...
prvo dobro nauci skriptati,pa onda radi svoj mod :S...

nastoe

Citat: ...:::---REZA---:::... poslato April 09, 2010, 22:36:37 POSLE PODNE
aj pls ucini mi uslugu bit cu ti vrlooo zahvalan..

pls stavi mi sta sve triban dodat u skriptu...

da bi moglo sve normalno funkcionirat.

Hvala brate.
Jesi ti normalan, da ti sve stavim? Pa to bi mi trebalo bar 3/4 dana ako ne i vise i jos ktome ti nebi znao di sta treba staviti tako da bi bilo uzaludno Sam ti je ljepo rekao....