SA-MP Forums Archive
[Ajuda] Erro no comando Teleporte - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Erro no comando Teleporte (/showthread.php?tid=361377)



Erro no comando Teleporte - brunoboy - 20.07.2012

Ola eu estive pesquisando como criar um comando de Teleporte e encontrei um tutorial e la estava isto mas ta dando 3 Erros:

Код:
if(strcmp(cmdtext,"/ilha", true)==0)
    {
        GameTextForPlayer(playerid, "~y~~h~]] ~r~~h~PEKENA ILHA ~y~~h~]]", 2500, 4);
        SetPlayerInterior(playerid,0);
        SetPlayerPos(playerid,263.6730,2905.4475,7.4086);
    ResetPlayerWeapons(playerid);
        GivePlayerWeapon(playerid,26,9999);
        new pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
        format(string, sizeof(string), "{FF0000}[TELEPORTE] {FFFFFF}%s foi para uma Pekena Ilha  {FF0000}( /Ilha )", pname);
        SendClientMessageToAll(0xFF0000FF, string);
        return 1;
    }
Erro:
Код:
C:\Users\Vitor\Desktop\Meu Primeiro Server\gamemodes\Server.pwn(19) : error 010: invalid function or declaration
C:\Users\Vitor\Desktop\Meu Primeiro Server\gamemodes\Server.pwn(27) : error 021: symbol already defined: "GetPlayerName"
C:\Users\Vitor\Desktop\Meu Primeiro Server\gamemodes\Server.pwn(30) : error 010: invalid function or declaration
C:\Users\Vitor\Desktop\Meu Primeiro Server\gamemodes\Server.pwn(33) : warning 203: symbol is never used: "pname"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.



Re: Erro no comando Teleporte - .FuneraL. - 20.07.2012

Retire o GetPlayerName e tente Compilar.


Re: Erro no comando Teleporte - Panico622 - 20.07.2012

pawn Код:
if(strcmp(cmdtext,"/ilha", true)==0)
{
    GameTextForPlayer(playerid, "~y~~h~]] ~r~~h~PEKENA ILHA ~y~~h~]]", 2500, 4);
    SetPlayerInterior(playerid,0);
    SetPlayerPos(playerid,263.6730,2905.4475,7.4086);
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid,26,9999);
    format(string, sizeof(string), "{FF0000}[TELEPORTE] {FFFFFF}%s foi para uma Pekena Ilha  {FF0000}( /Ilha )", pname);
    SendClientMessageToAll(0xFF0000FF, string);
    return 1;
}



Re : Erro no comando Teleporte - brunoboy - 20.07.2012

Ta tendo um erro agora Panico

Na linha 20:


Код:
if(strcmp(cmdtext,"/ilha", true)==0)         <-- Linha 20
{
    GameTextForPlayer(playerid, "~y~~h~]] ~r~~h~PEKENA ILHA ~y~~h~]]", 2500, 4);
    SetPlayerInterior(playerid,0);
	SetPlayerPos(playerid,263.6730,2905.4475,7.4086);
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,26,9999);
	format(string, sizeof(string), "{FF0000}[TELEPORTE] {FFFFFF}%s foi para uma Pekena Ilha  {FF0000}( /Ilha )", pname);
	SendClientMessageToAll(0xFF0000FF, string);   return 1;}



Re: Erro no comando Teleporte - Panico622 - 20.07.2012

cal й a linha que da o erro?


Re : Erro no comando Teleporte - brunoboy - 20.07.2012

Eu postei ai


Re: Erro no comando Teleporte - @Riichard - 20.07.2012

O Erro nгo esta nesta linha, posta o comando/linhas de cima.


Re : Erro no comando Teleporte - brunoboy - 20.07.2012

Eu estou criando um server do 0

E tudo que ele tem e isto :
Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>

#if defined FILTERSCRIPT

#endif

public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	SetGameModeText("Test");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	return 1;
}

if(strcmp(cmdtext,"/ilha", true)==0)
{
    GameTextForPlayer(playerid, "~y~~h~]] ~r~~h~PEKENA ILHA ~y~~h~]]", 2500, 4);
    SetPlayerInterior(playerid,0);
	SetPlayerPos(playerid,263.6730,2905.4475,7.4086);
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,26,9999);
	format(string, sizeof(string), "{FF0000}[TELEPORTE] {FFFFFF}%s foi para uma Pekena Ilha  {FF0000}( /Ilha )", pname);
	SendClientMessageToAll(0xFF0000FF, string);   return 1;}



Re: Erro no comando Teleporte - Bruno Alves - 20.07.2012

pawn Код:
if (strcmp (cmdtext, "/ ilha", true) == 0)
{
    GameTextForPlayer (playerid, "~ y ~ ~ h ~]] ~ r ~ ~ h ~ PEKENA ILHA ~ y ~ ~ h ~]]", 2500, 4);
    SetPlayerInterior (playerid, 0);
    SetPlayerPos (playerid, 263.6730,2905.4475,7.4086);
    ResetPlayerWeapons (playerid);
    GivePlayerWeapon (playerid, 26,9999);
    format (string, sizeof (string), "{FF0000} [teleporte] {FFFFFF}% s FOI UMA parбgrafo Pekena Ilha {FF0000} (/ Ilha)", pname);
    SendClientMessageToAll (0xFF0000FF, string);
    return 1;
}



Re: Erro no comando Teleporte - Ades - 20.07.2012

/\ para que include zcmd se vocк esta uzando strcmp ?