[AJUDA]Comandos -
wevertonneves - 09.10.2011
Olha meu problema e esse.eu fiзo uns comando de comidas e tals que seta life e tals
ate ai tudo certo
quando eu entro no servidor
eu posso digitar qualquer coisas tip /uisadguyafduysadas
aparece la voзe comeu o pastel alquem pode me ajudar
?
PHP код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <dini>
#define VPERDA 20 // Valor da quantidade de life que o player irб perder se nгo comer, no caso 20% de life.
#define VMIN 15 // Define o tempo em minutos que irб lanзar o timer para o player perder o life
#define MAXPLAYERS 500 // Defina a quantidade de slots configurados em seu server.cfg
new SLife[MAXPLAYERS]; //Variбvel salvamento life
new String[64]; // Variбvel global
forward Perder10Life(playerid); //Chamativa da callback
public OnFilterScriptInit()
{
Create3DTextLabel("Use:/Cardapio para ver as comidas.",0xFF0000AA ,1507.8744,-1714.6392,14.0469,25,0,50);
CreatePickup(1239,1507.8744,-1714.6392,14.0469,94.4999);
return true;
}
public OnFilterScriptExit()
{
for(new i=0; i<MAXPLAYERS; i++)
{
dini_IntSet(String, "sLife", SLife[i]);
}
return true;
}
main()
{
}
public OnPlayerConnect(playerid)
{
SetTimer("Perder10Life", 60000*VMIN, false);
SLife[playerid] = dini_Int(String, "sLife");
return true;
}
public OnPlayerDisconnect(playerid)
{
dini_IntSet(String, "sLife", SLife[playerid]);
return true;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/Cardapio", true) == 0)
{
if(!IsPlayerInRangeOfPoint(playerid, 2.0,1507.8744,-1714.6392,14.0469))
{
SendClientMessage(playerid,0xFF0000AA,"Comidas:");
SendClientMessage(playerid,0xFF0000AA,"/Pastel R$20,00,/Coxinha R$20,00,/Enroladinho R$20,00,/Paodequeijo R$15,00,");
SendClientMessage(playerid,0xFF0000AA,"/Paodesal R$15,00,/Salgadinho R$15,00,/Bolacha R$15,00");
SendClientMessage(playerid,0xFF0000AA,"Frutas:");
SendClientMessage(playerid,0xFF0000AA,"/Morango R$25,00,/Pera R$25,00,/Maзa R$25,00,/uva R$25,00.");
}
return 1;
}
if(strcmp(cmdtext, "/Pastel", true))
{
if(!IsPlayerInRangeOfPoint(playerid, 2.0, 1507.8744,-1714.6392,14.0469))
{
GivePlayerMoney(playerid, -20);
SendClientMessage(playerid,0xFF0000AA,"Voзe comeu um pastel");
SetPlayerHealth(playerid, 100);
}
return 1;
}
if(!strcmp("/Coxinha", cmdtext,true))
{
if(!IsPlayerInRangeOfPoint(playerid, 2.0, 1507.8744,-1714.6392,14.0469))
{
GivePlayerMoney(playerid, -20);
SendClientMessage(playerid,0xFF0000AA,"Voзe comeu uma coxinha");
SetPlayerHealth(playerid, 100);
}
return 1;
}
if(!strcmp("/Enroladinho", cmdtext, true))
{
if(!IsPlayerInRangeOfPoint(playerid, 2.0, 1507.8744,-1714.6392,14.0469))
{
GivePlayerMoney(playerid, -20);
SendClientMessage(playerid,0xFF0000AA,"Voзe comeu um enroladinho");
SetPlayerHealth(playerid, 100);
}
return 1;
} if(!strcmp("/Paodequeijo", cmdtext, true))
{
if(!IsPlayerInRangeOfPoint(playerid, 2.0, 1507.8744,-1714.6392,14.0469))
{
GivePlayerMoney(playerid, -15);
SendClientMessage(playerid,0xFF0000AA,"Voзe comeu um pao de queijo");
SetPlayerHealth(playerid, 100);
}
return 1;
}
if(!strcmp("/Paodesal", cmdtext, true))
{
if(!IsPlayerInRangeOfPoint(playerid, 2.0, 1507.8744,-1714.6392,14.0469))
GivePlayerMoney(playerid, -15);
SendClientMessage(playerid,0xFF0000AA,"Voзe comeu um pao de sal");
SetPlayerHealth(playerid, 100);
return 1;
}
if(!strcmp("/Salgadinho", cmdtext, true))
{
if(!IsPlayerInRangeOfPoint(playerid, 2.0, 1507.8744,-1714.6392,14.0469))
{
GivePlayerMoney(playerid, -15);
SendClientMessage(playerid,0xFF0000AA,"Voзe comeu um salgadinho");
SetPlayerHealth(playerid, 100);
}
return 1;
}
if(!strcmp("/Bolacha", cmdtext, true))
{
if(!IsPlayerInRangeOfPoint(playerid, 2.0, 1507.8744,-1714.6392,14.0469))
{
GivePlayerMoney(playerid, -15);
SendClientMessage(playerid,0xFF0000AA,"Voзe comeu uma bolacha");
SetPlayerHealth(playerid, 100);
}
return 1;
}
if(!strcmp("/Morango", cmdtext, true))
{
if(!IsPlayerInRangeOfPoint(playerid, 2.0, 1507.8744,-1714.6392,14.0469))
{
GivePlayerMoney(playerid, -25);
SendClientMessage(playerid,0xFF0000AA,"Voзe comeu um morango");
SetPlayerHealth(playerid, 100);
}
return 1;
}
if(!strcmp("/Pera", cmdtext, true))
{
if(!IsPlayerInRangeOfPoint(playerid, 2.0, 1507.8744,-1714.6392,14.0469))
{
GivePlayerMoney(playerid, -25);
SendClientMessage(playerid,0xFF0000AA,"Voзe comeu uma pera");
SetPlayerHealth(playerid, 100);
}
return 1;
}
if(!strcmp("/Maзa", cmdtext, true))
{
if(!IsPlayerInRangeOfPoint(playerid, 2.0, 1507.8744,-1714.6392,14.0469))
{
GivePlayerMoney(playerid, -25);
SendClientMessage(playerid,0xFF0000AA,"Voзe comeu uma maзa");
SetPlayerHealth(playerid, 100);
}
return 1;
}
if(!strcmp("/Uva", cmdtext, true))
{
if(!IsPlayerInRangeOfPoint(playerid, 2.0, 1507.8744,-1714.6392,14.0469))
{
GivePlayerMoney(playerid, -25);
SendClientMessage(playerid,0xFF0000AA,"Voзe comeu uma uma uva");
SetPlayerHealth(playerid, 100);
}
return 1;
}
return 0;
}
public Perder10Life(playerid)
{
new Float:Life,Shick[53],Shick1[43];
GetPlayerHealth(playerid, Life);
SetPlayerHealth(playerid, Life-VPERDA);
format(Shick, sizeof(Shick), "Vocк tem que re-abastecer seu estфmago a cada %d min.", VMIN);
SendClientMessage(playerid, 0x8B4513FF, Shick);
format(Shick, sizeof(Shick), "Vocк perdeu {FF1493}%f{FFA500} de Life.", VPERDA);
SendClientMessage(playerid, 0xFFA500FF , Shick1);
return true;
}
ai sempre apareзe voзe comeu o pastel
a cordenada para dar o comando e essa:
PHP код:
1507.8744,-1714.6392,14.0469
Peзo ajuda deis de Ja Obrigado
Re: [AJUDA]Comandos -
Dolby - 09.10.2011
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/Cardapio", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0,1507.8744,-1714.6392,14.0469))
{
SendClientMessage(playerid,0xFF0000AA,"Comidas:");
SendClientMessage(playerid,0xFF0000AA,"/Pastel R$20,00,/Coxinha R$20,00,/Enroladinho R$20,00,/Paodequeijo R$15,00,");
SendClientMessage(playerid,0xFF0000AA,"/Paodesal R$15,00,/Salgadinho R$15,00,/Bolacha R$15,00");
SendClientMessage(playerid,0xFF0000AA,"Frutas:");
SendClientMessage(playerid,0xFF0000AA,"/Morango R$25,00,/Pera R$25,00,/Maзa R$25,00,/uva R$25,00.");
return 1;
}
return 1;
}
if(strcmp(cmdtext, "/Pastel", true))
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1507.8744,-1714.6392,14.0469))
{
GivePlayerMoney(playerid, -20);
SendClientMessage(playerid,0xFF0000AA,"Voзe comeu um pastel");
SetPlayerHealth(playerid, 100);
return 1;
}
return 1;
}
if(!strcmp("/Coxinha", cmdtext,true))
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1507.8744,-1714.6392,14.0469))
{
GivePlayerMoney(playerid, -20);
SendClientMessage(playerid,0xFF0000AA,"Voзe comeu uma coxinha");
SetPlayerHealth(playerid, 100);
return 1;
}
return 1;
}
if(!strcmp("/Enroladinho", cmdtext, true))
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1507.8744,-1714.6392,14.0469))
{
GivePlayerMoney(playerid, -20);
SendClientMessage(playerid,0xFF0000AA,"Voзe comeu um enroladinho");
SetPlayerHealth(playerid, 100);
return 1;
}
return 1;
} if(!strcmp("/Paodequeijo", cmdtext, true))
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1507.8744,-1714.6392,14.0469))
{
GivePlayerMoney(playerid, -15);
SendClientMessage(playerid,0xFF0000AA,"Voзe comeu um pao de queijo");
SetPlayerHealth(playerid, 100);
return 1;
}
return 1;
}
if(!strcmp("/Paodesal", cmdtext, true))
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1507.8744,-1714.6392,14.0469)) return GivePlayerMoney(playerid, -15),SendClientMessage(playerid,0xFF0000AA,"Voзe comeu um pao de sal"),SetPlayerHealth(playerid, 100);
return 1;
}
if(!strcmp("/Salgadinho", cmdtext, true))
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1507.8744,-1714.6392,14.0469))
{
GivePlayerMoney(playerid, -15);
SendClientMessage(playerid,0xFF0000AA,"Voзe comeu um salgadinho");
SetPlayerHealth(playerid, 100);
return 1;
}
return 1;
}
if(!strcmp("/Bolacha", cmdtext, true))
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1507.8744,-1714.6392,14.0469))
{
GivePlayerMoney(playerid, -15);
SendClientMessage(playerid,0xFF0000AA,"Voзe comeu uma bolacha");
SetPlayerHealth(playerid, 100);
return 1;
}
return 1;
}
if(!strcmp("/Morango", cmdtext, true))
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1507.8744,-1714.6392,14.0469))
{
GivePlayerMoney(playerid, -25);
SendClientMessage(playerid,0xFF0000AA,"Voзe comeu um morango");
SetPlayerHealth(playerid, 100);
return 1;
}
return 1;
}
if(!strcmp("/Pera", cmdtext, true))
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1507.8744,-1714.6392,14.0469))
{
GivePlayerMoney(playerid, -25);
SendClientMessage(playerid,0xFF0000AA,"Voзe comeu uma pera");
SetPlayerHealth(playerid, 100);
return 1;
}
return 1;
}
if(!strcmp("/Maзa", cmdtext, true))
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1507.8744,-1714.6392,14.0469))
{
GivePlayerMoney(playerid, -25);
SendClientMessage(playerid,0xFF0000AA,"Voзe comeu uma maзa");
SetPlayerHealth(playerid, 100);
}
return 1;
}
if(!strcmp("/Uva", cmdtext, true))
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1507.8744,-1714.6392,14.0469))
{
GivePlayerMoney(playerid, -25);
SendClientMessage(playerid,0xFF0000AA,"Voзe comeu uma uma uva");
SetPlayerHealth(playerid, 100);
return 1;
}
return 1;
}
return 0;
}
Tenta assim
#Identa ai.
Re: [AJUDA]Comandos -
wevertonneves - 09.10.2011
deu esses erros
PHP код:
C:\Documents and Settings\weverton\Meus documentos\samp\filterscripts\fome.pwn(148) : warning: 213: tag mismatch
C:\Documents and Settings\weverton\Meus documentos\samp\filterscripts\fome.pwn(148) : warning: 217: loose indentation
C:\Documents and Settings\weverton\Meus documentos\samp\filterscripts\fome.pwn(148) : warning: 217: loose indentation
C:\Documents and Settings\weverton\Meus documentos\samp\filterscripts\fome.pwn(148) : warning: 217: loose indentation
C:\Documents and Settings\weverton\Meus documentos\samp\filterscripts\fome.pwn(148) : warning: 217: loose indentation
C:\Documents and Settings\weverton\Meus documentos\samp\filterscripts\fome.pwn(148) : warning: 217: loose indentation
C:\Documents and Settings\weverton\Meus documentos\samp\filterscripts\fome.pwn(148) : warning: 217: loose indentation
C:\Documents and Settings\weverton\Meus documentos\samp\filterscripts\fome.pwn(148) : warning: 217: loose indentation
C:\Documents and Settings\weverton\Meus documentos\samp\filterscripts\fome.pwn(148) : warning: 217: loose indentation
C:\Documents and Settings\weverton\Meus documentos\samp\filterscripts\fome.pwn(148) : warning: 217: loose indentation
C:\Documents and Settings\weverton\Meus documentos\samp\filterscripts\fome.pwn(148) : warning: 217: loose indentation
C:\Documents and Settings\weverton\Meus documentos\samp\filterscripts\fome.pwn(148) : warning: 217: loose indentation
C:\Documents and Settings\weverton\Meus documentos\samp\filterscripts\fome.pwn(148) : warning: 217: loose indentation
C:\Documents and Settings\weverton\Meus documentos\samp\filterscripts\fome.pwn(148) : warning: 217: loose indentation
C:\Documents and Settings\weverton\Meus documentos\samp\filterscripts\fome.pwn(148) : warning: 217: loose indentation
C:\Documents and Settings\weverton\Meus documentos\samp\filterscripts\fome.pwn(148) : warning: 217: loose indentation
C:\Documents and Settings\weverton\Meus documentos\samp\filterscripts\fome.pwn(148) : warning: 217: loose indentation
Re: [AJUDA]Comandos -
Dolby - 09.10.2011
Sao Apenas Loose Identations,foi onde eu lhe disse para voce Identar...
Como acabar com os Loose Identations.
https://sampforum.blast.hk/showthread.php?tid=271525
Re: [AJUDA]Comandos -
MatriXBorn - 09.10.2011
So colocar a #include PSF que some todas as Indendations
Re: [AJUDA]Comandos -
Dolby - 09.10.2011
Ou...
No Inicio do GameMode.
Re: [AJUDA]Comandos -
wevertonneves - 09.10.2011
aparece isso
PHP код:
C:\Arquivos de programas\Infernus Pawn by Louco\include\PSF\1.2F3#PSF_LIB\PSF_DPPFI.inc(21) : error: 010: invalid function or declaration
C:\Documents and Settings\weverton\Meus documentos\samp\filterscripts\fome.pwn(21) : warning: 213: tag mismatch
Re: [AJUDA]Comandos -
Dolby - 09.10.2011
Tira a Include PSF e manda a linha que ta dando Tag Mismatch.
Re: [AJUDA]Comandos -
wevertonneves - 09.10.2011
o erros sumiu mais eu chego no lugar corrdenda eu dou /uva e aparece voзe comeu o pastel
sendo que no /uva ta voзe comeu uma uva algum pode me ajudar e resolver isso?
Re: [AJUDA]Comandos -
wevertonneves - 09.10.2011
Obrigado a todos valew pela
caso presisem de min to aki
fimeza vlw
denovo OBrigado