SA-MP Forums Archive
Ajuda - 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 (/showthread.php?tid=128298)



Ajuda - seykan - 17.02.2010

pessoal 2 duvidas.
Eu to criei 1 teleporte e veio isso quando cliquei em "Gerar"

Код:
if(strcmp(cmdtext,"/Rampa",true)==0)
{
new vehicleid = GetPlayerVehicleID(playerid);
new State = GetPlayerState(playerid);
if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
{
GameTextForPlayer(playerid,"Bem-Vindo(a) a Rampa!",4000,6);
LinkVehicleToInterior(vehicleid,0);
SetPlayerInterior(playerid,0);
return SetVehiclePos(vehicleid,2158.4670410156 1042.2408447266 2267.8205566406);
}
SetPlayerPos(playerid,2158.4670410156 1042.2408447266 2267.8205566406);
SetPlayerInterior(playerid,0);
GameTextForPlayer(playerid,"Bem-Vindo(a) a Rampa!",4000,6);
return 1;
}
onde eu coloco ele no meu Filter? ou Gamemode?
OBS:eu nao sei se na parte da Coordenadas ta certo tipow se tinha q ser:
Код:
x=2158.4670410156 y=1042.2408447266 z=2267.8205566406);
ou do jeito q esta se tiver errado me avise ^^

segunda duvida: como q eu crio 1 Lista de comandos?


Re: Ajuda - andmeida10 - 17.02.2010

isso vc coloca no OnPlayerCommandText...


criar uma lista de comandos:

Код:
if (strcmp("/teles", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,COR,"Bem-vindo ao coiso dos comandos");
SendClientMessage(playerid,COR,"/o cmd : o k faz");
SendClientMessage(playerid,COR,"/o cmd : o k faz");
SendClientMessage(playerid,COR,"/o cmd : o k faz");
SendClientMessage(playerid,COR,"/o cmd : o k faz");
SendClientMessage(playerid,"/o cmd : o k faz");
}



Re: Ajuda - OxygenBR - 17.02.2010

Quote:
Originally Posted by andmeida10
isso vc coloca no OnPlayerCommandText...


criar uma lista de comandos:

Код:
if (strcmp("/teles", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,"Bem-vindo ao coiso dos comandos");
SendClientMessage(playerid,"/o cmd : o k faz");
SendClientMessage(playerid,"/o cmd : o k faz");
SendClientMessage(playerid,"/o cmd : o k faz");
SendClientMessage(playerid,"/o cmd : o k faz");
SendClientMessage(playerid,"/o cmd : o k faz");
}
Nгo seria SendClientMessage(playerid, COR, "Bem-vindo ao coiso dos comandos");?


Re: Ajuda - andmeida10 - 17.02.2010

e mesmo... desculpa... vou jaja remediar.....


Re: Ajuda - seykan - 17.02.2010

Quote:
Originally Posted by andmeida10
isso vc coloca no OnPlayerCommandText...


criar uma lista de comandos:

Код:
if (strcmp("/teles", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,COR,"Bem-vindo ao coiso dos comandos");
SendClientMessage(playerid,COR,"/o cmd : o k faz");
SendClientMessage(playerid,COR,"/o cmd : o k faz");
SendClientMessage(playerid,COR,"/o cmd : o k faz");
SendClientMessage(playerid,COR,"/o cmd : o k faz");
SendClientMessage(playerid,"/o cmd : o k faz");
}
ai cara eu coloquei assim:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
 	if (strcmp("/mycommand", cmdtext, true, 10) == 0)

	if(strcmp(cmdtext,"/Rampa",true)==0)
	{
	new vehicleid = GetPlayerVehicleID(playerid);
	new State = GetPlayerState(playerid);
	if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
	{
	GameTextForPlayer(playerid,"Bem-Vindo(a) a Rampa!",4000,6);
	LinkVehicleToInterior(vehicleid,0);
	SetPlayerInterior(playerid,0);
	return SetVehiclePos(vehicleid,2158.4670410156 1042.2408447266 2267.8205566406);
	}
	SetPlayerPos(playerid,2158.4670410156 1042.2408447266 2267.8205566406);
	SetPlayerInterior(playerid,0);
	GameTextForPlayer(playerid,"Bem-Vindo(a) a Rampa!",4000,6);
	return 1;
	}
	{
		// Do something here
	
		return 1;
	}
	return 0;
}
e n da certo, eu ate cliquei pra compilar pra v se dava algum erro e dava isso:

Код:
C:\Documents and Settings\Cliente\Desktop\Revolution GTA Online\SAMP 0.3 Server\filterscripts\Revolution_GTA_Online.pwn(151) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Cliente\Desktop\Revolution GTA Online\SAMP 0.3 Server\filterscripts\Revolution_GTA_Online.pwn(151) : warning 217: loose indentation
C:\Documents and Settings\Cliente\Desktop\Revolution GTA Online\SAMP 0.3 Server\filterscripts\Revolution_GTA_Online.pwn(151) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Cliente\Desktop\Revolution GTA Online\SAMP 0.3 Server\filterscripts\Revolution_GTA_Online.pwn(164) : error 001: expected token: ",", but found "-rational value-"
C:\Documents and Settings\Cliente\Desktop\Revolution GTA Online\SAMP 0.3 Server\filterscripts\Revolution_GTA_Online.pwn(164) : warning 215: expression has no effect
C:\Documents and Settings\Cliente\Desktop\Revolution GTA Online\SAMP 0.3 Server\filterscripts\Revolution_GTA_Online.pwn(164) : error 001: expected token: ";", but found "-rational value-"
C:\Documents and Settings\Cliente\Desktop\Revolution GTA Online\SAMP 0.3 Server\filterscripts\Revolution_GTA_Online.pwn(164) : warning 215: expression has no effect
C:\Documents and Settings\Cliente\Desktop\Revolution GTA Online\SAMP 0.3 Server\filterscripts\Revolution_GTA_Online.pwn(164) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Cliente\Desktop\Revolution GTA Online\SAMP 0.3 Server\filterscripts\Revolution_GTA_Online.pwn(164) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
tem como me ajuda?


Re: Ajuda - andmeida10 - 17.02.2010

tira isto:


Код:
{
 	if (strcmp("/mycommand", cmdtext, true, 10) == 0)

agora ja deve dar


Re: Ajuda - Lucas_Brasil - 17.02.2010

nгo cara, tira sу o
pawn Код:
if (strcmp("/mycommand", cmdtext, true, 10) == 0)

se tirar a 1° chave vai dar erro, ela й da callback


Re: Ajuda - seykan - 17.02.2010

Quote:
Originally Posted by andmeida10
tira isto:


Код:
{
 	if (strcmp("/mycommand", cmdtext, true, 10) == 0)

agora ja deve dar
eu retirei e coloquei fui tenta compila pra v se dava erro agora deu isso:

Код:
C:\Documents and Settings\Cliente\Desktop\Revolution GTA Online\SAMP 0.3 Server\filterscripts\Revolution_GTA_Online.pwn(159) : error 001: expected token: ",", but found "-rational value-"
C:\Documents and Settings\Cliente\Desktop\Revolution GTA Online\SAMP 0.3 Server\filterscripts\Revolution_GTA_Online.pwn(159) : warning 215: expression has no effect
C:\Documents and Settings\Cliente\Desktop\Revolution GTA Online\SAMP 0.3 Server\filterscripts\Revolution_GTA_Online.pwn(159) : error 001: expected token: ";", but found "-rational value-"
C:\Documents and Settings\Cliente\Desktop\Revolution GTA Online\SAMP 0.3 Server\filterscripts\Revolution_GTA_Online.pwn(159) : warning 215: expression has no effect
C:\Documents and Settings\Cliente\Desktop\Revolution GTA Online\SAMP 0.3 Server\filterscripts\Revolution_GTA_Online.pwn(159) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Cliente\Desktop\Revolution GTA Online\SAMP 0.3 Server\filterscripts\Revolution_GTA_Online.pwn(159) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
A primeira "{" ta la ainda mais ainda ta dando o erro

OBS: eu to colocando em 1 Arquivo PWN Filter nao no Gamemode tem q ser no Gamemode ou tanto faiz?


Re: Ajuda - speliarmos - 17.02.2010

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext,"/Rampa",true)==0)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        new State = GetPlayerState(playerid);
        if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
        {
            GameTextForPlayer(playerid,"Bem-Vindo(a) a Rampa!",4000,6);
            LinkVehicleToInterior(vehicleid,0);
            SetPlayerInterior(playerid,0);
            return SetVehiclePos(vehicleid,2158.4670410156 1042.2408447266 2267.8205566406);
        }
        SetPlayerPos(playerid,2158.4670410156 1042.2408447266 2267.8205566406);
        SetPlayerInterior(playerid,0);
        GameTextForPlayer(playerid,"Bem-Vindo(a) a Rampa!",4000,6);
        return 1;
    }
    return 0;
}
faзa assim.


Re: Ajuda - seykan - 17.02.2010

Quote:
Originally Posted by [VGS
speliarmos_OC ]
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext,"/Rampa",true)==0)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        new State = GetPlayerState(playerid);
        if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
        {
            GameTextForPlayer(playerid,"Bem-Vindo(a) a Rampa!",4000,6);
            LinkVehicleToInterior(vehicleid,0);
            SetPlayerInterior(playerid,0);
            return SetVehiclePos(vehicleid,2158.4670410156 1042.2408447266 2267.8205566406);
        }
        SetPlayerPos(playerid,2158.4670410156 1042.2408447266 2267.8205566406);
        SetPlayerInterior(playerid,0);
        GameTextForPlayer(playerid,"Bem-Vindo(a) a Rampa!",4000,6);
        return 1;
    }
    return 0;
}
faзa assim.
eu fiz como vc disse mais novamente qando fui compilar deu erro u.u

Код:
C:\Documents and Settings\Cliente\Desktop\Revolution GTA Online\SAMP 0.3 Server\filterscripts\Revolution_GTA_Online.pwn(159) : error 001: expected token: ",", but found "-rational value-"
C:\Documents and Settings\Cliente\Desktop\Revolution GTA Online\SAMP 0.3 Server\filterscripts\Revolution_GTA_Online.pwn(159) : warning 215: expression has no effect
C:\Documents and Settings\Cliente\Desktop\Revolution GTA Online\SAMP 0.3 Server\filterscripts\Revolution_GTA_Online.pwn(159) : error 001: expected token: ";", but found "-rational value-"
C:\Documents and Settings\Cliente\Desktop\Revolution GTA Online\SAMP 0.3 Server\filterscripts\Revolution_GTA_Online.pwn(159) : warning 215: expression has no effect
C:\Documents and Settings\Cliente\Desktop\Revolution GTA Online\SAMP 0.3 Server\filterscripts\Revolution_GTA_Online.pwn(159) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Cliente\Desktop\Revolution GTA Online\SAMP 0.3 Server\filterscripts\Revolution_GTA_Online.pwn(159) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
sera q n eh algo de errado no q ta escrito