Jump to content
  • 0

pomoc Nefungující Script


AK47

Dotaz

Zdravím, tak jsem zkoušel udělat port na "Kopec", ale někde je chyba

 

 

 

#include <a_samp>

 

#if defined FILTERSCRIPT

 

public OnPlayerCommandText(playerid, cmdtext[])

{

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

{

if(IsPlayerAdmin(playerid))

{

SetPlayerPos(playerid,28.6587,2246.2188,126.6797);

SendClientMessage(playerid, -1, "Úspěšně jsi se portl na {00ff00}Kopec smrti!");

}

return 1;

}

 

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

{

if(IsPlayerAdmin(playerid))

{

SetPlayerPos(playerid,28.6587,2246.2188,126.6797);

SendClientMessage(playerid, -1, "Úspěšně jsi se portl na {00ff00}Kopec smrti!");

new nick[24]; //premenna pre meno hraca

GetPlayerName(playerid, nick, 24); //tento riadok nastavi premennu ako hracove meno

new sprava[128]; //vytvorime premennu ktoru naformatujeme a nasledne odosleme do chatu (128 = maximalne 128 znakov)

format(sprava, 128, "Administrátor %s plánuje akci {00ff00}Kopec smrti", nick); //tuto to dosadi miesto %s hracove meno (teda premennu ktora v sebe nesie hracove meno)

SendClientMessageToAll(0xFF0000FF, sprava); //odosle tu naformatovanu spravu

}

 

return 1;

}

 

return 0;

}

#endif

 

 

Nehlásí to chybu ani warning, ale na serveru to prostě říká, že příkaz neexistuje. Nevíte co s tím? Děkuji

Link to comment
Share on other sites

15 odpovědí na tuto otázku

Recommended Posts

  • 0

Protoze tam máš podmínku že pokut není admin tak nic měl bys to mít asi takto -->

if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFF0000FF,"Nejsi Administrátor"); //odosle tu naformat

 

Ale pokut ten příkaz máš pro hráče tak je k ničemu protože musí být admin ;)

Link to comment
Share on other sites

  • 0

#if defined FILTERSCRIPT

 

a

 

#endif

 

odendej a pojede to

 

C:\Documents and Settings\AK47\Plocha\samp03e_svr_win32\pawno\kopec.pwn(16) : warning 217: loose indentation

C:\Documents and Settings\AK47\Plocha\samp03e_svr_win32\pawno\kopec.pwn(19) : warning 217: loose indentation

C:\Documents and Settings\AK47\Plocha\samp03e_svr_win32\pawno\kopec.pwn(32) : warning 217: loose indentation

C:\Documents and Settings\AK47\Plocha\samp03e_svr_win32\pawno\kopec.pwn(35) : warning 217: loose indentation

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Link to comment
Share on other sites

  • 0

#if defined FILTERSCRIPT

 

a

 

#endif

 

odendej a pojede to

No určite, to s tým nič nemá.. nevadí ak to tam má.. teda ak hore má #define filterscript

takto.. daj ten public on player command preč s tej podmienky, presun ho niekam pod #endif.. a pojde ti to

Link to comment
Share on other sites

  • 0

Máš tam někde před OnPlayerCommandText nejakou chybu např neukončenou zavorku a podobně.Celý to přepiš a příště pracuj s includem zcmd - lehčí psaní scriptu např

 

CMD:kopecport(playerid,params[])

{

if(!IsPlayerAdmin(playerid))

return SendClientMessage(playerid,COLOR_RED,"nejsi admin);

SetPlayerpos(playerid,xyz);

New name[20];

New zprava[128];

GetPlayerName(playerid,name,sizeof(name));

format(zprava,sizeof(zprava),"Admin %s se odwarpoval na kopec",name);

SendClientMessageToAll(COLOR_ZELENA,zprava);

return 0;

}

Link to comment
Share on other sites

  • 0

a

 

   if(strcmp(cmd, "/kopec", true) == 0) //prikaz
{
 if (IsPlayerAdmin(playerid))
 {
    SetPlayerPos(playerid,28.6587,2246.2188,126.6797);
    SetPlayerInterior(playerid,0);
    SendClientMessage(playerid,COLOR_WHITE,"Teleportoval jsi se na kopec smrti");
 }
}

return 1;


   if(strcmp(cmd, "/kopecport", true) == 0) //prikaz
{
 if (IsPlayerAdmin(playerid))
 {
    SetPlayerPos(playerid,28.6587,2246.2188,126.6797);
    SetPlayerInterior(playerid,0);
    SendClientMessage(playerid,COLOR_WHITE,"Teleportoval jsi se na kopec smrti");
  	 new string [254];
       new playername[MAX_PLAYER_NAME];
       GetPlayerName(playerid,playername,sizeof(playername));
       format(string,sizeof(string),"Admin %s plánuje akci kopec smrti.", playername);
       SendClientMessageToAll(0xFF0000FF,string);
 }
}
return 1;

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...