Jump to content
  • 0

pomoc [HELP, PLS!!]


Jamo

Dotaz

23 odpovědí na tuto otázku

Recommended Posts

  • 0

#include

 

public OnPlayerCommandText(playerid, cmdtext[])

{

if (strcmp("/4d", cmdtext, true, 10) == 0)

 

{

SendClientMessageToAll(0x22FF00FF,"Hráč %s sa teleportoval ku kasínu Four Dragons príkazom /4d !");

return 1;

 

return 0;

 

}

 

}

Link to comment
Share on other sites

  • 0

Máš to špatně.

Zkus toto:

#include 

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/4d", cmdtext, true, 10) == 0)
{
SendClientMessageToAll(0x22FF00FF,"Hráč %s sa teleportoval ku kasínu Four Dragons príkazom /4d !");
return 1;
}
return 0;
}

Link to comment
Share on other sites

  • 0

Jak napsal DealeR.. Musíš si ještě udělat souřadnice na které ho to portne. To znamená SetPlayerPos(playerid,X,Y,Z); // Místo X,Y,Z si dej souřadnice.

Potom máš sice napsané, že Hráč %s ... ale nemáš nikde napsané to jméno, které to tam dosadí. Takže jak ti končí text tímto ", tak za tím udělej čárku (",) a napiš tam name.

 

Celé by ti to mělo vypadat takto:

 

#include 

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/4d", cmdtext, true, 10) == 0)
{
new name[20];
GetPlayerName(playerid,name,20);
SetPlayerPos(playerid,X,Y,Z); // Místo X,Y,Z si dej souřadnice.
SendClientMessageToAll(0x22FF00FF,"Hráč %s sa teleportoval ku kasínu Four Dragons príkazom /4d !",name);
return 1;
}
return 0;
}

Link to comment
Share on other sites

  • 0

funkce SendClientMessageToAll jen a pouze odesle zpravu do chatu nic jineho neumi. Tedy musis si ten text nejdriv nastavit pomoci funkce format:

new string[128];
format(string,sizeof(string),"Hráč %s sa teleportoval ku kasínu Four Dragons príkazom /4d !",name);
SendClientMessageToAll(0x22FF00FF,string);

Link to comment
Share on other sites

  • 0

a ked dam toto

tak zas prikaz neexistuje

#include 

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/test", cmdtext, true, 10) == 0)

{
		  SendClientMessage(playerid,0xFF0000FF, "Toto je len testovacia správa !");
		  return 1;

	   return 0;

}

}

Link to comment
Share on other sites

  • 0

Dával jsi F5 a na server soubor s příponou ".amx" ? jinak nemůžeš dávat return 1 a pod to hned return 0 to je uplne divne

 

public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/caw", true)){
prikaz funkce
return true;
}
return SendClientMessage(playerid, -1 "Špatný příkaz"); // return, neboli žádný příkaz není vyvolán
}

Link to comment
Share on other sites

  • 0
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/test", cmdtext, true, 10) == 0)
{
	SendClientMessage(playerid,0xFF0000FF, "Toto je len testovacia správa !");
	return 1;
}
return 0;
}

Link to comment
Share on other sites

  • 0

este jedna vec:

 

#include 
#include 

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/uzi", cmdtext, true, 10) == 0)

{
		  SendClientMessage(playerid, 0xFF0000FF, "Dostal si uzi !");
		  GivePlayerWeapon(playerid, 28, 9999);
	   return 1;

}
	 return 0;

}

 

neviem co je na tom zle, pls poradte este dos ma to stve.

Link to comment
Share on other sites

  • 0

Zdar, to co tu píšeš je absolutní píčovina, to co tu všichni píšou je správně a chyba neni u nikoho jiného než u tebe, tak ti teda presne poradim jak postupovat ..

 


 

1)

 

pust webovej prohlížeč a klikni na toto:

SA-MP Server DOWNLOAD

 

 

2)

 

otevři rar a překopíruj složku pawno, třeba na plochu.

 

 

3)

 

otevři pawno.exe, úplně nahoře klikni na 'file' a ve výberu dej 'New' ..

 

 

4)

 

všechno co tam je smaž, a překopíruj tam toto:

 

#include 

public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp("/ahoj", cmdtext, true))
{
SendClientMessage(playerid, -1, "Ahoj, tento script funguje, chyba je u tebe, unknown command? ne, ja ho nevidim !");
return true;
}
return false;
}

 

 

5)

 

dej F5 a ulož to někam, potom až bude vše hotové napíše ti to v takovém rámečku tento text

Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase

 

 

6)

 

tam kam si to uložil se vytvořili 2 soubory, jeden s příponou AMX a druhý s příponou PWN, ten s příponou AMX překopíruj do filterscriptů na serveru, zapni server, logni se jako rcon, dej příkaz "/rcon loadfs jmeno", místo "jméno" zadej text jména souboru bez přípony ".amx", napiš příkaz "/ahoj"..

 


 

žeby to náhodou šlo?

Link to comment
Share on other sites

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