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



erros .-. - GuilhermeNunes - 30.03.2017

ajuda ai gente eu peguei esse cmd da wiki pedia deu nisso

PHP код:
if(strcmp(cmdtext"/doctor"true) == 0)
{
    new 
Float:health;
    
GetPlayerHealth(playerid,health);
    if (
health 50.0)
    {
        
SetPlayerHealth(playerid50.0);
        
SendClientMessage(playerid, -1"texto");
    }
    return 
1;

PHP код:
C:\Projeto (CLS)\gamemodes\CLSRPG.pwn(444) : error 010invalid function or declaration
C
:\Projeto (CLS)\gamemodes\CLSRPG.pwn(447) : error 021symbol already defined"GetPlayerHealth"
C:\Projeto (CLS)\gamemodes\CLSRPG.pwn(448) : error 010invalid function or declaration
C
:\Projeto (CLS)\gamemodes\CLSRPG.pwn(453) : error 010invalid function or declaration
C
:\Projeto (CLS)\gamemodes\CLSRPG.pwn(456) : warning 203symbol is never used"health"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors




Re: erros .-. - Rato22 - 30.03.2017

Poderia me dizer,o que queria fazer com esse comando ? б funзгo ...


Re: erros .-. - GuilhermeNunes - 30.03.2017

na wiki tava dizendo que esse comando ve quando й a vida do player asssim

/doctor

o (nick do player) possui 45% de vida

entendeu?


Re: erros .-. - Rato22 - 30.03.2017

PHP код:
if(strcmp(cmdtext"/doctor"true) == 0
{
new 
tmp[256], idxstring[128];
tmp strtok(paramsidx);
new 
id;
if(!
IsNumeric(tmp))
id ReturnPlayerID(tmp);
else
id strval(tmp);
if(
Player[playerid][pAdmin] < 1)
return 
SendClientMessage(playeridCOR_ERRO"ERRO: Vocк nгo tem permissгo para usar este comando!");
if(!
strlen(tmp))
return 
SendClientMessage(playeridCOR_USOCORRETO"Uso: /vervida [id]");
new 
Float:health;
GetPlayerHealth(id,health);
format(stringsizeof(string), "Vida do Player %s: %.1f"idhealth);
SendClientMessage(playerid0xE3E3E3FF,string);
return 
1;




Re: erros .-. - GuilhermeNunes - 30.03.2017

Quote:
Originally Posted by Rato22
Посмотреть сообщение
PHP код:
if(strcmp(cmdtext"/doctor"true) == 0
{
new 
tmp[256], idxstring[128];
tmp strtok(paramsidx);
new 
id;
if(!
IsNumeric(tmp))
id ReturnPlayerID(tmp);
else
id strval(tmp);
if(
Player[playerid][pAdmin] < 1)
return 
SendClientMessage(playeridCOR_ERRO"ERRO: Vocк nгo tem permissгo para usar este comando!");
if(!
strlen(tmp))
return 
SendClientMessage(playeridCOR_USOCORRETO"Uso: /vervida [id]");
new 
Float:health;
GetPlayerHealth(id,health);
format(stringsizeof(string), "Vida do Player %s: %.1f"idhealth);
SendClientMessage(playerid0xE3E3E3FF,string);
return 
1;

mano se ta mando muitos codes com erros olha

C:\Projeto (CLS)\pawno\include\dof2.inc(1021) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Projeto (CLS)\pawno\include\dof2.inc(1051) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Projeto (CLS)\pawno\include\dof2.inc(1074) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Projeto (CLS)\pawno\include\dof2.inc(1134) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Projeto (CLS)\pawno\include\sscanf2.inc(305) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Projeto (CLS)\pawno\include\sscanf2.inc(305) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Projeto (CLS)\pawno\include\sscanf2.inc(365) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Projeto (CLS)\pawno\include\sscanf2.inc(365) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Projeto (CLS)\filterscripts\SystemAdmin.pwn(170) : error 010: invalid function or declaration
C:\Projeto (CLS)\filterscripts\SystemAdmin.pwn(174) : error 010: invalid function or declaration
C:\Projeto (CLS)\filterscripts\SystemAdmin.pwn(177) : error 010: invalid function or declaration
C:\Projeto (CLS)\filterscripts\SystemAdmin.pwn(179) : error 010: invalid function or declaration
C:\Projeto (CLS)\filterscripts\SystemAdmin.pwn(182) : error 010: invalid function or declaration
C:\Projeto (CLS)\filterscripts\SystemAdmin.pwn(183) : error 010: invalid function or declaration
C:\Projeto (CLS)\filterscripts\SystemAdmin.pwn(185) : error 010: invalid function or declaration
C:\Projeto (CLS)\filterscripts\SystemAdmin.pwn(186) : error 010: invalid function or declaration
C:\Projeto (CLS)\filterscripts\SystemAdmin.pwn(190) : error 021: symbol already defined: "GetPlayerHealth"
C:\Projeto (CLS)\filterscripts\SystemAdmin.pwn(192) : error 021: symbol already defined: "format"
C:\Projeto (CLS)\filterscripts\SystemAdmin.pwn(195) : error 010: invalid function or declaration
C:\Projeto (CLS)\filterscripts\SystemAdmin.pwn(310) : warning 203: symbol is never used: "health"
C:\Projeto (CLS)\filterscripts\SystemAdmin.pwn(310) : warning 203: symbol is never used: "id"
C:\Projeto (CLS)\filterscripts\SystemAdmin.pwn(310) : warning 203: symbol is never used: "idx"
C:\Projeto (CLS)\filterscripts\SystemAdmin.pwn(310) : warning 203: symbol is never used: "string"
C:\Projeto (CLS)\filterscripts\SystemAdmin.pwn(310) : warning 203: symbol is never used: "tmp"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


11 Errors.


Re: erros .-. - GuilhermeNunes - 31.03.2017

ajudaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa


Re: erros .-. - JhefTFJ - 31.03.2017

PHP код:
if(strcmp(cmdtext"/doctor"true) == 0)
{
    new 
Float:HP;
    
GetPlayerHealth(playerid,HP);
    if(
HP 100)
    {
        
GivePlayerMoney(playerid,-100);
        
SetPlayerHealth(playerid,100);
        
SendClientMessage(playerid, -1"TEXTO"); // AQUI A MSG VAI SE PLAYER USAR O COMANDO AE VAI SAIR UMA MSG, EX: VOCК ACRESCENTOU LIFE!
    
}
    else
    {
        
SendClientMessage(playerid, -1"TEXTO"); // MSG QUANDO O PLAYER FOR USARO COMANDO NOVAMENTE VAI AVISAR QUE ESTБ COM O LIFE CHEIO!
    
}
    return 
1;




Re: erros .-. - GuilhermeNunes - 31.03.2017

Nгo mano n й esse comando й um comando assim

/vervida id

o (aqui o nick do cara) possui 34 de vida

o (aqui o nick do cara) possui 60 de vida
e assim vai


Re: erros .-. - ViniBorn - 31.03.2017

O que vocк usa pra criar comandos?


Re: erros .-. - GuilhermeNunes - 31.03.2017

Quote:
Originally Posted by ViniBorn
Посмотреть сообщение
O que vocк usa pra criar comandos?
ZCMD e sscanf