Jump to content
  • 0

UNKNOWN COMMAND


ImTouchk

Question

Problema intalnita (descriere): Am incercat sa incep cu un gamemode simplu de roleplay si inca n-am facut foarte multe chestii pe el(am facut doar register si un mic sistem de deathtimer daca stiti), si am incercat sa folosesc niste functii pentru un sistem de DeathTimer: Cand ajungi la 20HP intrii in deathtimer, primesti freeze, (in curand fiindca nu stiu cum se face si tre sa ma mai uit la tutoriale) ti se pune o animatie cum stai pe jos, si se seteaza un timer de 120 secunde. Cand ajungi cu viata la 20 automat se adauga variabila din enum numita DT si DTT (Death Timer Timer, stiu, e ciudat) iar dupa ce s-a terminat timer-ul ti se scoate acel DTT (se pune pe 0). O data ce a ajuns la 0 primesti un mesaj cum poti folosii /acceptdeath care normal ar trebuii sa te dea la o casa din Montgomerry sau Blueberry (unde te da cand nu ai loc de spawn si cazi in jos, fiindca nu e gata) dar cand am testat NICI NU PRIMESTI -HP (cel putin nu am primit cand am sarit de pe o cladire, nu stiu daca e chiar destul de mare) si NICI NU MERGE COMANDA /acceptdeath. Imi da SERVER: UNKNOWN COMMAND. Nu stiu ce are... Am avut niste warning-uri si am mai rezolvat, dar tot nu-i dau capat.
Ero(area / rile) / warning-(ul / urile): SERVER: UNKNOWN COMMAND (In-Game)

C:\Users\mugur\Downloads\MAIN-ROLEPLAY\gamemodes\main roleplay.pwn(119) : warning 213: tag mismatch
C:\Users\mugur\Downloads\MAIN-ROLEPLAY\gamemodes\main roleplay.pwn(120) : warning 213: tag mismatch
C:\Users\mugur\Downloads\MAIN-ROLEPLAY\gamemodes\main roleplay.pwn(169) : warning 235: public function lacks forward declaration (symbol "OnPlayerHealthChange")


Liniile de cod / sursa / script-ul(obligatoriu):

/acceptdeath ( ZCMD + SSCANF2 ; comanda )

CMD:acceptdeath(playerid, params[])
{
    if(!PlayerInfo[playerid][DT] == 1) return SendClientMessage(playerid, 0xfffffff, "Nu esti in deathtimer!");
    if(!PlayerInfo[playerid][DTT] == 1) return SendClientMessage(playerid, 0xfffffff, "Nu au trecut 120 secunde!");
     SetPlayerPos(playerid,317.2694,54.9657,3.3750);
    SendClientMessage(playerid, 0xfffffff, "Un medic care nu era la datorie te-a gasit si te-a dus la el acasa.");
    SendClientMessage(playerid, 0xfffffff, "Acolo ti-a oferit primul ajutor iar acum te simti bine!");
    TogglePlayerControllable(playerid, 1);
    PlayerInfo[playerid][DT] = 0;
     return 1;
}

OnPlayerHealthChange ( variabila care am gasit-o pe niste tutoriale dar vad ca nu apare pe wiki samp )

public OnPlayerHealthChange(playerid, Float:newhealth, Float:oldhealth)
{
	if(!newhealth > 20)
 	{
    	TogglePlayerControllable(playerid,0);
   	 	new Text3D:label = Create3DTextLabel("(( JUCATORUL ESTE RANIT. IN-CHARACTER ESTE PE JOS. ))", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
        SendClientMessage(playerid, 0xff00000, "Ai intrat in DEATH-TIMER! Peste 120 secunde vei putea folosii /deathtimer.");
        SetTimerEx("dttimer", 120000, false, "i", playerid);
        PlayerInfo[playerid][DT] = 1;
        PlayerInfo[playerid][DTT] = 1;
    }
 	return 1;
}

public dttimer(playerid) ( variabila care ar trebuii sa se aplice dupa ce s-a terminat acel timer )

public dttimer(playerid)
{
	SendClientMessage(playerid, 0xff00000, "Au trecut 120 secunde. Acum poti da /acceptdeath.");
	PlayerInfo[playerid][DTT] = 0;
}

forward dttimer + enum pInfo

enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pKills,
    pDeaths,
    DT,
	DTT
}
new PlayerInfo[MAX_PLAYERS][pInfo];

forward dttimer(playerid);


Imagini / Video (optional): Nu cred ca este nevoie.
Ati incercat sa rezolvati singur?: Cred ca am lucrat mai mult de o ora.... Deci da.

:D

Link to comment
Share on other sites

Recommended Posts

  • 0
14 minutes ago, ImTouchk said:

 

4 minutes ago, ImTouchk said:

http://pastebin.com/KjchLUkp

Cum arata gamemode-ul acum

1.Acel public OnPlayerCommandPerdormed pune.l sub OnPlayerSpawn, si verifica dacă ai pluginul sscanf si vezi sa fie pus în server cfg postează si server cfg aici.

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
44 minutes ago, ImTouchk said:

CMD:acceptdeath(playerid, params[]) {     if(!PlayerInfo[playerid][DT] == 1) return SendClientMessage(playerid, 0xfffffff, "Nu esti in deathtimer!");     if(!PlayerInfo[playerid][DTT] == 1) return SendClientMessage(playerid, 0xfffffff, "Nu au trecut 120 secunde!");      SetPlayerPos(playerid,317.2694,54.9657,3.3750);     SendClientMessage(playerid, 0xfffffff, "Un medic care nu era la datorie te-a gasit si te-a dus la el acasa.");     SendClientMessage(playerid, 0xfffffff, "Acolo ti-a oferit primul ajutor iar acum te simti bine!");     TogglePlayerControllable(playerid, 1);     PlayerInfo[playerid][DT] = 0;      return 1; }

CMD:acceptdeath(playerid, params[]) {     if(PlayerInfo[playerid][DT] != 1) return SendClientMessage(playerid, 0xfffffff, "Nu esti in deathtimer!");     if(PlayerInfo[playerid][DTT] != 1) return SendClientMessage(playerid, 0xfffffff, "Nu au trecut 120 secunde!");      SetPlayerPos(playerid,317.2694,54.9657,3.3750);     SendClientMessage(playerid, 0xfffffff, "Un medic care nu era la datorie te-a gasit si te-a dus la el acasa.");     SendClientMessage(playerid, 0xfffffff, "Acolo ti-a oferit primul ajutor iar acum te simti bine!");     TogglePlayerControllable(playerid, 1);     PlayerInfo[playerid][DT] = 0;      return 1; }

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
2 minutes ago, DaEdRiC-FoX said:

CMD:acceptdeath(playerid, params[]) {     if(PlayerInfo[playerid][DT] != 1) return SendClientMessage(playerid, 0xfffffff, "Nu esti in deathtimer!");     if(PlayerInfo[playerid][DTT] != 1) return SendClientMessage(playerid, 0xfffffff, "Nu au trecut 120 secunde!");      SetPlayerPos(playerid,317.2694,54.9657,3.3750);     SendClientMessage(playerid, 0xfffffff, "Un medic care nu era la datorie te-a gasit si te-a dus la el acasa.");     SendClientMessage(playerid, 0xfffffff, "Acolo ti-a oferit primul ajutor iar acum te simti bine!");     TogglePlayerControllable(playerid, 1);     PlayerInfo[playerid][DT] = 0;      return 1; }

Multumesc pentru sprijin dar, cum am spus mai sus:
Nu stiu ce are gamemode-ul de nu merge nicio comanda si niciun edit facut de mine, deci practic tot ce e lucrat de mine este nul. Stii ce asi putea face?

:D

Link to comment
Share on other sites

  • 0
13 minutes ago, ImTouchk said:

Multumesc pentru sprijin dar, cum am spus mai sus:
Nu stiu ce are gamemode-ul de nu merge nicio comanda si niciun edit facut de mine, deci practic tot ce e lucrat de mine este nul. Stii ce asi putea face?

Nu stiu ce gamemode folosești, poate dacă ai da mai multe detalii te.am ajuta. Si comanda era greșită, eu ti.am făcut cum era corect.

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
Just now, ImTouchk said:

Gamemode unic = new.pwn cu tot ce am facut eu.

mainrp.pwn

Baga.l în paste bin.

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
6 minutes ago, ImTouchk said:

1.de ce nu folosești mysql?

2.ai parametri gresitit, tu nu stii cum se folosește "!"

3.normal ca nu.ti merg come zile dacă ție îți lipsește callback.ul OnPlayerCommandText, care trebuie redenumit în OnPlayerCommandperformed si adăugat în paranteză după ultimul cuvânt, success.Dar văd că tu nu.l ai deloc.

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
Just now, DaEdRiC-FoX said:

1.de ce nu folosești mysql?

2.ai parametri gresitit, tu nu stii cum se folosește "!"

3.normal ca nu.ti merg come zile dacă ție îți lipsește callback.ul OnPlayerCommandText, care trebuie redenumit în OnPlayerCommandperformed si adăugat în paranteză după ultimul cuvânt, success.Dar văd că tu nu.l ai deloc.

1. Nu vreau sa folosesc MySQL deoarece nu ma pricep in PHP ( nu un nivel experimentat )

2. Posibil sa fie cum zici tu , adica cel mai probabil.

3. Am crezut ca nu trebuie OnPlayerCommandText cand se foloseste ZCMD.

Ai putea sa ma ajuti te rog cu el? (Daca poti si ai timp)

:D

Link to comment
Share on other sites

  • 0
10 minutes ago, ImTouchk said:

1. Nu vreau sa folosesc MySQL deoarece nu ma pricep in PHP ( nu un nivel experimentat )

2. Posibil sa fie cum zici tu , adica cel mai probabil.

3. Am crezut ca nu trebuie OnPlayerCommandText cand se foloseste ZCMD.

Ai putea sa ma ajuti te rog cu el? (Daca poti si ai timp)

1.Nu ai nevoie de php în mysql

2.

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    
    return }

Adaugi asta sub alt public.m ai pe la mijlocul scriptului.

 

EDIT: Trebuie să  returnezi 1 altfel îți dă eroare când folosești comanda, dar ea merge.

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
6 minutes ago, DaEdRiC-FoX said:

1.Nu ai nevoie de php în mysql

2.


public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    
    return }

Adaugi asta sub alt public.m ai pe la mijlocul scriptului.

 

EDIT: Trebuie să  returnezi 1 altfel îți dă eroare când folosești comanda, dar ea merge.

C:\Users\mugur\Downloads\MAIN-ROLEPLAY\gamemodes\mainroleplay.pwn(203) : warning 235: public function lacks forward declaration (symbol "OnPlayerHealthChange")
C:\Users\mugur\Downloads\MAIN-ROLEPLAY\gamemodes\mainroleplay.pwn(205) : warning 213: tag mismatch
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


2 Warnings.
 

File or function not found (eroare 19 , cand pornesc gamemode-ul)

:D

Link to comment
Share on other sites

  • 0
6 minutes ago, ImTouchk said:

C:\Users\mugur\Downloads\MAIN-ROLEPLAY\gamemodes\mainroleplay.pwn(203) : warning 235: public function lacks forward declaration (symbol "OnPlayerHealthChange")
C:\Users\mugur\Downloads\MAIN-ROLEPLAY\gamemodes\mainroleplay.pwn(205) : warning 213: tag mismatch
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


2 Warnings.
 

File or function not found (eroare 19 , cand pornesc gamemode-ul)

Da.mi liniile cu erorile

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
Just now, ImTouchk said:

Nu exista nicio eroare, pur si smplu am doar warning-urile de mai sus. 

Pai da.mi liniile

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
1 minute ago, DaEdRiC-FoX said:

Pai da.mi liniile

203 public OnPlayerHealthChange(playerid, Float:newhealth, Float:oldhealth)
{
  205  if(!newhealth > 20)
     {
        TogglePlayerControllable(playerid,0);
            new Text3D:label = Create3DTextLabel("(( JUCATORUL ESTE RANIT. IN-CHARACTER ESTE PE JOS. ))", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
        SendClientMessage(playerid, 0xff00000, "Ai intrat in DEATH-TIMER! Peste 120 secunde vei putea folosii /deathtimer.");
        SetTimerEx("dttimer", 120000, false, "i", playerid);
        PlayerInfo[playerid][DT] = 1;
        PlayerInfo[playerid][DTT] = 1;
    }
     return 1;
}

:D

Link to comment
Share on other sites

  • 0
Just now, ImTouchk said:

203 public OnPlayerHealthChange(playerid, Float:newhealth, Float:oldhealth)
{
  205  if(!newhealth > 20)
     {
        TogglePlayerControllable(playerid,0);
            new Text3D:label = Create3DTextLabel("(( JUCATORUL ESTE RANIT. IN-CHARACTER ESTE PE JOS. ))", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
        SendClientMessage(playerid, 0xff00000, "Ai intrat in DEATH-TIMER! Peste 120 secunde vei putea folosii /deathtimer.");
        SetTimerEx("dttimer", 120000, false, "i", playerid);
        PlayerInfo[playerid][DT] = 1;
        PlayerInfo[playerid][DTT] = 1;
    }
     return 1;
}

 forward OnPlayerHealthChange(playerid, Float:newhealth, Float:oldhealth);

public OnPlayerHealthChange(playerid, Float:newhealth, Float:oldhealth)
{
  205  if(newhealth > 20)
     {
        TogglePlayerControllable(playerid,0);
            new Text3D:label = Create3DTextLabel("(( JUCATORUL ESTE RANIT. IN-CHARACTER ESTE PE JOS. ))", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
        SendClientMessage(playerid, 0xff00000, "Ai intrat in DEATH-TIMER! Peste 120 secunde vei putea folosii /deathtimer.");
        SetTimerEx("dttimer", 120000, false, "i", playerid);
        PlayerInfo[playerid][DT] = 1;
        PlayerInfo[playerid][DTT] = 1;
    }
     return 1;
}

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
3 minutes ago, DaEdRiC-FoX said:

 forward OnPlayerHealthChange(playerid, Float:newhealth, Float:oldhealth);

public OnPlayerHealthChange(playerid, Float:newhealth, Float:oldhealth)
{
  205  if(newhealth > 20)
     {
        TogglePlayerControllable(playerid,0);
            new Text3D:label = Create3DTextLabel("(( JUCATORUL ESTE RANIT. IN-CHARACTER ESTE PE JOS. ))", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
        SendClientMessage(playerid, 0xff00000, "Ai intrat in DEATH-TIMER! Peste 120 secunde vei putea folosii /deathtimer.");
        SetTimerEx("dttimer", 120000, false, "i", playerid);
        PlayerInfo[playerid][DT] = 1;
        PlayerInfo[playerid][DTT] = 1;
    }
     return 1;
}

Tot imi da Runtime error 19 la pornire.. Dar a disparut acel warning la compilare si mai este doar unul (linie 206, tag mistmatch)

Edited by ImTouchk

:D

Link to comment
Share on other sites

  • 0
11 minutes ago, ImTouchk said:

203 public OnPlayerHealthChange(playerid, Float:newhealth, Float:oldhealth)
{
  205  if(!newhealth > 20)
     {
        TogglePlayerControllable(playerid,0);
            new Text3D:label = Create3DTextLabel("(( JUCATORUL ESTE RANIT. IN-CHARACTER ESTE PE JOS. ))", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
        SendClientMessage(playerid, 0xff00000, "Ai intrat in DEATH-TIMER! Peste 120 secunde vei putea folosii /deathtimer.");
        SetTimerEx("dttimer", 120000, false, "i", playerid);
        PlayerInfo[playerid][DT] = 1;
        PlayerInfo[playerid][DTT] = 1;
    }
     return 1;
}

 Vrei sa ghicesc in stele ca e linia 206?

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
4 minutes ago, ImTouchk said:

    if(!newhealth > 20) = linia 206

fiindca am adaugat acel forward

În postul ala ti.am modificat și acolo. 

If(newhealth > 20)

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
2 minutes ago, DaEdRiC-FoX said:

În postul ala ti.am modificat și acolo. 

If(newhealth > 20)

N-am vazut, scuze. Dar daca il inlocuiesc o sa-mi aplice deathtimer-ul daca am HP mai mare de 20?

EDIT: Tot ramane acel runtime error wtf nush dc

Runtime error 19: File or function not found

Edited by ImTouchk

:D

Link to comment
Share on other sites

  • 0
10 minutes ago, ImTouchk said:

    if(!newhealth > 20) = linia 206

fiindca am adaugat acel forward

Da timer.ul va porni, baga din nou scriptul pe paste bin.

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
2 minutes ago, DaEdRiC-FoX said:

1.Acel public OnPlayerCommandPerdormed pune.l sub OnPlayerSpawn, si verifica dacă ai pluginul sscanf si vezi sa fie pus în server cfg postează si server cfg aici.

Sunt foarte idiot, n-am pus sscanf2 in server.cfg :)) Multumesc de ajutor, acum merge tot! Se poate da T/C si ii multumesc mult @DaEdRiC-FoX!

:D

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.