[Ajuda] Erro em checagem de comando
#1

PHP код:
CMD:loteria(playeridparams[])
    {
            if 
PlayerToPoint(2playerid,822.0087,1.7976,1004.1797) || PlayerToPoint(2playerid,822.0084,6.1601,1004.1797) || PlayerToPoint(2playerid,822.0084,4.2043,1004.1797) && PlayerToPoint(2playerid,822.0084,-0.1904,1004.1797,94.7460);
            if(
PlayerInfo[playerid][pLottoNr] > 0)return SendClientMessage(playeridCOLOR_GREY"   Vocк jб tem um bilhete de loteria !");
            if(
GetPlayerMoney(playerid) < 10)return SendClientMessage(playeridCOLOR_GREY"   Vocк nгo tem R$10 para pagar o nъmero de loteria !");
            new 
lottonr;
            if(
sscanf(params"d"lottonr))return SendClientMessage(playeridCOLOR_WHITE,"USE: /loteria [nъmero]");
            if(
lottonr || lottonr 50)return SendClientMessage(playeridCOLOR_GREY"   Nъmero da loteria, de 1 a 50 !");
            new 
string[128];
            
format(stringsizeof(string), "* Vocк comprou um bilhete de loteria com nъmero: %d."lottonr);
            
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
            
GiveDinheiro(playerid, - 10);
            
PlayerInfo[playerid][pLottoNr] = lottonr;
            return 
true;
    } 
Код HTML:
C:\Users\Usuario\Desktop\Brasil Better City\gamemodes\BPS.pwn(76167) : warning 202: number of arguments does not match definition
C:\Users\Usuario\Desktop\Brasil Better City\gamemodes\BPS.pwn(76167) : error 001: expected token: "*then", but found ";"
C:\Users\Usuario\Desktop\Brasil Better City\gamemodes\BPS.pwn(76167) : error 036: empty statement
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#2

PHP код:
CMD:loteria(playeridparams[]) 

    if ( 
PlayerToPoint(2playerid,822.0087,1.7976,1004.1797) || PlayerToPoint(2playerid,822.0084,6.1601,1004.1797) || PlayerToPoint(2playerid,822.0084,4.2043,1004.1797) && PlayerToPoint(2playerid,822.0084,-0.1904,1004.1797,94.7460) )
    { 
        if( 
PlayerInfo[playerid][pLottoNr] > 0)
            return 
SendClientMessage(playeridCOLOR_GREY"   Vocк jб tem um bilhete de loteria !"); 
        if ( 
GetPlayerMoney(playerid) < 10)
            return 
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo tem R$10 para pagar o nъmero de loteria !"); 
        new 
lottonr
        if( 
sscanf(params"d"lottonr) )
            return 
SendClientMessage(playeridCOLOR_WHITE,"USE: /loteria [nъmero]"); 
        if (
lottonr || lottonr 50 )
            return 
SendClientMessage(playeridCOLOR_GREY"   Nъmero da loteria, de 1 a 50 !"); 
        
        new 
string[128]; 
        
format(stringsizeof(string), "* Vocк comprou um bilhete de loteria com nъmero: %d."lottonr); 
        
SendClientMessage(playeridCOLOR_LIGHTBLUEstring); 
        
GiveDinheiro(playerid, - 10); 
        
PlayerInfo[playerid][pLottoNr] = lottonr
    }
    return 
true

Existe uma funзгo nativa para isto: https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Reply
#3

Veja as regras e assim nгo terб seu tуpico excluнdo.Seu tнtulo estб contra as regras .
Sua condicional estб errada, e esse PlayerToPoint deve ser usado IsPlayerInRangeOfPoint.

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint

Deverб ser usado da seguinte forma :
if (IsPlayerInRangeOfPoint(playerid, Float:range, Float, Float:y, Float:z)) - Sem a chave no final" ;"

Dк uma olhada nesse tutorial de estruturas condicionais e vocк irб entender.
https://sampforum.blast.hk/showthread.php?tid=467770

if(!IsPlayerInRangeOfPoint(playerid, 5.0, 822.0087, 1.7976, 1004.1797)) return SendClientMessage(playerid, -1,"Vocк nгo estб no local correto);

Fiz apenas com a primeira posiзгo para vocк ter uma noзгo do que fazer, termina de acertar o cуdigo e veja se funciona .
Reply
#4

Bastava organizar o cуdigo que vocк iria ver o erro.

PHP код:
CMD:loteria(playeridparams[]) 

    if( !
IsPlayerInRangeOfPoint(playerid5.0822.0087,1.7976,1004.1797) || 
        !
IsPlayerInRangeOfPoint(playerid5.0822.0084,6.1601,1004.1797) ||
        !
IsPlayerInRangeOfPoint(playerid5.0822.0084,4.2043,1004.1797) &&
        !
IsPlayerInRangeOfPoint(playerid5.0822.0084,-0.1904,1004.1797))
        return 
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo estб em uma lotйrica!"); 
        
    if(
PlayerInfo[playerid][pLottoNr] > 0)
        return 
SendClientMessage(playeridCOLOR_GREY"   Vocк jб tem um bilhete de loteria !"); 
        
    if(
GetPlayerMoney(playerid) < 10)
        return 
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo tem R$10 para pagar o nъmero de loteria !"); 
        
    new 
lottonr
    
    if(
sscanf(params"d"lottonr))
        return 
SendClientMessage(playeridCOLOR_WHITE,"USE: /loteria [nъmero]"); 
        
    if(
lottonr || lottonr 50)
        return 
SendClientMessage(playeridCOLOR_GREY"   Nъmero da loteria, de 1 a 50 !"); 
    new 
string[128]; 
    
format(stringsizeof(string), "* Vocк comprou um bilhete de loteria com nъmero: %d."lottonr); 
    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring); 
    
GiveDinheiro(playerid, - 10); 
    
PlayerInfo[playerid][pLottoNr] = lottonr
    
    return 
true

E a propуsito:

Quote:
Originally Posted by SkullFire
Посмотреть сообщение
Veja as regras e assim nгo terб seu tуpico excluнdo.Seu tнtulo estб contra as regras.
Jб o deletei uma vez pelo mesmo motivo.
Reply
#5

PHP код:
 C:\Users\Usuario\Desktop\Brasil Better City\gamemodes\BPS.pwn(76167) : warning 202number of arguments does not match definition
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase

Header size
:          39296 bytes
Code size
:          4408100 bytes
Data size
:         10514120 bytes
Stack
/heap size:      16384 bytesestimated maxusageunknowndue to recursion
Total requirements
:14977900 bytes

1 Warning

Linha Do WARNING
PHP код:
    if ( PlayerToPoint(2playerid,822.0087,1.7976,1004.1797) || PlayerToPoint(2playerid,822.0084,6.1601,1004.1797) || PlayerToPoint(2playerid,822.0084,4.2043,1004.1797) || PlayerToPoint(2playerid,822.0084,-0.1904,1004.1797,94.7460) )
    { 
Reply
#6

O Lуs acabou de lhe passar um cуdigo pronto pra uso, basta usar ctrl c e ctrl v e seja feliz.
Reply
#7

obrigado los ajudou muito +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)