[Ajuda] ERROS
#1

Alguйm me ajuda ae..

Erros/Warning:

PHP код:
C:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(42794) : warning 219local variable "SendClientMessage" shadows a variable at a preceding level
C
:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(42806) : error 012invalid function callnot a valid address
C
:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(42806) : warning 215expression has no effect
C
:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(42806) : warning 215expression has no effect
C
:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(42806) : warning 215expression has no effect
C
:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(42806) : error 001expected token";"but found ")"
C:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(42806) : error 029invalid expressionassumed zero
C
:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(42806) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors

Linhas:

PHP код:
forward Caminhoneiro_CarregarDesc(playerid);
public 
Caminhoneiro_CarregarDesc(playerid)
{
    switch (
PlayerData[playerid][PartedoTrabalho])
    {
        case 
1:
        {
            new 
StartLoc[50], EndLoc[50], Load[50], Float:xFloat:yFloat:zUnloadMsg[100];
            
PlayerData[playerid][PartedoTrabalho] = 2;
            
DisablePlayerCheckpoint(playerid);
            
format(StartLoc50LocalCargaDescarga[PlayerData[playerid][Carregamento]][NomedoLocal]);
            
format(EndLoc50LocalCargaDescarga[PlayerData[playerid][Descarregamento]][NomedoLocal]);
            
format(Load50ACargas[PlayerData[playerid][CargaID]][LoadName]);
            
LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocX];
            
LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocY];
            
LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocZ];
            
SetPlayerCheckpoint(playeridxyz7);
            
TogglePlayerControllable(playerid1);
            
format(UnloadMsg100"Leve a carga de %s atй %s."LoadEndLoc);
            
SendClientMessage(playerid0xFFFFFFFFUnloadMsg);
        }
        case 
2:
        {
            new 
StartLoc[50], EndLoc[50], Load[50], Name[24];
            
GetPlayerName(playeridNamesizeof(Name));
            
format(StartLoc50LocalCargaDescarga[PlayerData[playerid][Carregamento]][NomedoLocal]);
            
format(EndLoc50LocalCargaDescarga[PlayerData[playerid][Descarregamento]][NomedoLocal]);
            
format(Load50ACargas[PlayerData[playerid][CargaID]][LoadName]);
            new 
Float:x1Float:y1Float:x2Float:y2Float:DistanceMessage[128], Payment;
            
x1 LocalCargaDescarga[PlayerData[playerid][Carregamento]][LocX];
            
y1 LocalCargaDescarga[PlayerData[playerid][Carregamento]][LocY];
            
x2 LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocX];
            
y2 LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocY];
            
Distance floatsqroot(((x2 x1) * (x2 x1)) + ((y2 y1) * (y2 y1)));
            
Payment floatround((Distance ACargas[PlayerData[playerid][CargaID]][PayPerUnit]), floatround_floor);
            
RewardPlayer(playeridPayment);
            
format(Message128"Vocк finalizou a entrega e ganhou R$%i."Payment);
            
PlayerData[playerid][pDentroCaminhao] = 0;
            
SendClientMessage(playerid0xFFFFFFFFMessage);
            
TogglePlayerControllable(playerid1);
            
Caminhoneiro_AcabouTrabalho(playerid);
        }
    }
    return 
1;

Reply
#2

PHP код:
forward Caminhoneiro_CarregarDesc(playerid); 
public 
Caminhoneiro_CarregarDesc(playerid

    switch (
PlayerData[playerid][PartedoTrabalho]) 
    { 
        case 
1
        { 
            new 
StartLoc[50], EndLoc[50], Load[50], Float:xFloat:yFloat:zUnloadMsg[100]; 
            
PlayerData[playerid][PartedoTrabalho] = 2
            
DisablePlayerCheckpoint(playerid); 
            
format(StartLoc50LocalCargaDescarga[PlayerData[playerid][Carregamento]][NomedoLocal]); 
            
format(EndLoc50LocalCargaDescarga[PlayerData[playerid][Descarregamento]][NomedoLocal]); 
            
format(Load50ACargas[PlayerData[playerid][CargaID]][LoadName]); 
            
LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocX]; 
            
LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocY]; 
            
LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocZ]; 
            
SetPlayerCheckpoint(playeridxyz7); 
            
TogglePlayerControllable(playerid1); 
            
format(UnloadMsg100"Leve a carga de %s atй %s."LoadEndLoc); 
            
SendClientMessage(playerid0xFFFFFFFFUnloadMsg); 
        } 
        case 
2
        { 
            new 
StartLoc[50], EndLoc[50], Load[50], Name[24]; 
            
GetPlayerName(playeridNamesizeof(Name)); 
            
format(StartLoc50LocalCargaDescarga[PlayerData[playerid][Carregamento]][NomedoLocal]); 
            
format(EndLoc50LocalCargaDescarga[PlayerData[playerid][Descarregamento]][NomedoLocal]); 
            
format(Load50ACargas[PlayerData[playerid][CargaID]][LoadName]); 
            new 
Float:x1Float:y1Float:x2Float:y2Float:DistanceMessage[128], Payment
            
x1 LocalCargaDescarga[PlayerData[playerid][Carregamento]][LocX]; 
            
y1 LocalCargaDescarga[PlayerData[playerid][Carregamento]][LocY]; 
            
x2 LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocX]; 
            
y2 LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocY]; 
            
Distance floatsqroot(((x2 x1) * (x2 x1)) + ((y2 y1) * (y2 y1))); 
            
Payment floatround((Distance ACargas[PlayerData[playerid][CargaID]][PayPerUnit]), floatround_floor)); 
            
RewardPlayer(playeridPayment); 
            
format(Message128"Vocк finalizou a entrega e ganhou R$%i."Payment); 
            
SendClientMessage(playerid0xFFFFFFFFMessage); 
            
PlayerData[playerid][pDentroCaminhao] = 0
            
TogglePlayerControllable(playerid1); 
            
Caminhoneiro_AcabouTrabalho(playerid); 
        } 
    } 
    return 
1

Tente agora.
Reply
#3

Quote:
Originally Posted by Gguiz
Посмотреть сообщение
PHP код:
forward Caminhoneiro_CarregarDesc(playerid); 
public 
Caminhoneiro_CarregarDesc(playerid

    switch (
PlayerData[playerid][PartedoTrabalho]) 
    { 
        case 
1
        { 
            new 
StartLoc[50], EndLoc[50], Load[50], Float:xFloat:yFloat:zUnloadMsg[100]; 
            
PlayerData[playerid][PartedoTrabalho] = 2
            
DisablePlayerCheckpoint(playerid); 
            
format(StartLoc50LocalCargaDescarga[PlayerData[playerid][Carregamento]][NomedoLocal]); 
            
format(EndLoc50LocalCargaDescarga[PlayerData[playerid][Descarregamento]][NomedoLocal]); 
            
format(Load50ACargas[PlayerData[playerid][CargaID]][LoadName]); 
            
LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocX]; 
            
LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocY]; 
            
LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocZ]; 
            
SetPlayerCheckpoint(playeridxyz7); 
            
TogglePlayerControllable(playerid1); 
            
format(UnloadMsg100"Leve a carga de %s atй %s."LoadEndLoc); 
            
SendClientMessage(playerid0xFFFFFFFFUnloadMsg); 
        } 
        case 
2
        { 
            new 
StartLoc[50], EndLoc[50], Load[50], Name[24]; 
            
GetPlayerName(playeridNamesizeof(Name)); 
            
format(StartLoc50LocalCargaDescarga[PlayerData[playerid][Carregamento]][NomedoLocal]); 
            
format(EndLoc50LocalCargaDescarga[PlayerData[playerid][Descarregamento]][NomedoLocal]); 
            
format(Load50ACargas[PlayerData[playerid][CargaID]][LoadName]); 
            new 
Float:x1Float:y1Float:x2Float:y2Float:DistanceMessage[128], Payment
            
x1 LocalCargaDescarga[PlayerData[playerid][Carregamento]][LocX]; 
            
y1 LocalCargaDescarga[PlayerData[playerid][Carregamento]][LocY]; 
            
x2 LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocX]; 
            
y2 LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocY]; 
            
Distance floatsqroot(((x2 x1) * (x2 x1)) + ((y2 y1) * (y2 y1))); 
            
Payment floatround((Distance ACargas[PlayerData[playerid][CargaID]][PayPerUnit]), floatround_floor)); 
            
RewardPlayer(playeridPayment); 
            
format(Message128"Vocк finalizou a entrega e ganhou R$%i."Payment); 
            
SendClientMessage(playerid0xFFFFFFFFMessage); 
            
PlayerData[playerid][pDentroCaminhao] = 0
            
TogglePlayerControllable(playerid1); 
            
Caminhoneiro_AcabouTrabalho(playerid); 
        } 
    } 
    return 
1

Tente agora.
PHP код:
C:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(42795) : warning 219local variable "SendClientMessage" shadows a variable at a preceding level
C
:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(42801) : error 001expected token";"but found ")"
C:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(42801) : error 029invalid expressionassumed zero
C
:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(42801) : warning 215expression has no effect
C
:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(42804) : error 012invalid function callnot a valid address
C
:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(42804) : warning 215expression has no effect
C
:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(42804) : warning 215expression has no effect
C
:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(42804) : warning 215expression has no effect
C
:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(42804) : error 001expected token";"but found ")"
C:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(42804) : error 029invalid expressionassumed zero
C
:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(42804) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
6 Errors

Reply
#4

Consertei boa parte dos erros, agora tб dando isso.

Quote:

C:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(42795) : warning 219: local variable "SendClientMessage" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.

Reply
#5

No lugar da cor
Код:
 0xFFFFFFFF
define no inicio do seu gm COR_QUA 0xFFFFFFFF

e coloque COR_QUA
Reply
#6

Quote:
Originally Posted by BrunoLuiz
Посмотреть сообщение
No lugar da cor
Код:
 0xFFFFFFFF
define no inicio do seu gm COR_QUA 0xFFFFFFFF

e coloque COR_QUA
Mesma coisa

PHP код:
C:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(42795) : warning 219local variable "SendClientMessage" shadows a variable at a preceding level
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
1 Warning

Reply
#7

up ~~
Reply
#8

Tente:

Код:
forward Caminhoneiro_CarregarDesc(playerid); 
public Caminhoneiro_CarregarDesc(playerid) 
{ 
    switch (PlayerData[playerid][PartedoTrabalho]) 
    { 
        case 1: 
        { 
            new StartLoc[50], EndLoc[50], Load[50], Float:x, Float:y, Float:z, UnloadMsg[100]; 
            PlayerData[playerid][PartedoTrabalho] = 2; 
            DisablePlayerCheckpoint(playerid); 
            format(StartLoc, 50, LocalCargaDescarga[PlayerData[playerid][Carregamento]][NomedoLocal]); 
            format(EndLoc, 50, LocalCargaDescarga[PlayerData[playerid][Descarregamento]][NomedoLocal]); 
            format(Load, 50, ACargas[PlayerData[playerid][CargaID]][LoadName]); 
            x = LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocX]; 
            y = LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocY]; 
            z = LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocZ]; 
            SetPlayerCheckpoint(playerid, x, y, z, 7); 
            TogglePlayerControllable(playerid, 1); 
            SendClientMessageEx(playerid, -1, "Leve a carga de %s atй %s.", Load, EndLoc); 
        } 
        case 2: 
        { 
            new StartLoc[50], EndLoc[50], Load[50], Name[24]; 
            GetPlayerName(playerid, Name, sizeof(Name)); 
            format(StartLoc, 50, LocalCargaDescarga[PlayerData[playerid][Carregamento]][NomedoLocal]); 
            format(EndLoc, 50, LocalCargaDescarga[PlayerData[playerid][Descarregamento]][NomedoLocal]); 
            format(Load, 50, ACargas[PlayerData[playerid][CargaID]][LoadName]); 

            new Float:x1, Float:y1, Float:x2, Float:y2, Float:Distance, Message[128], Payment; 
            x1 = LocalCargaDescarga[PlayerData[playerid][Carregamento]][LocX]; 
            y1 = LocalCargaDescarga[PlayerData[playerid][Carregamento]][LocY]; 
            x2 = LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocX]; 
            y2 = LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocY]; 
            Distance = floatsqroot(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1))); 
            Payment = floatround((Distance * ACargas[PlayerData[playerid][CargaID]][PayPerUnit]), floatround_floor); 
            RewardPlayer(playerid, Payment); 
            
            PlayerData[playerid][pDentroCaminhao] = 0; 

            SendClientMessageEx(playerid, -1, "Vocк finalizou a entrega e ganhou R$%d.", Payment); 
            TogglePlayerControllable(playerid, 1); 
            Caminhoneiro_AcabouTrabalho(playerid); 
        } 
    } 
    return 1; 
}
Reply
#9

Quote:
Originally Posted by willttoonn
Посмотреть сообщение
Tente:

Код:
forward Caminhoneiro_CarregarDesc(playerid); 
public Caminhoneiro_CarregarDesc(playerid) 
{ 
    switch (PlayerData[playerid][PartedoTrabalho]) 
    { 
        case 1: 
        { 
            new StartLoc[50], EndLoc[50], Load[50], Float:x, Float:y, Float:z, UnloadMsg[100]; 
            PlayerData[playerid][PartedoTrabalho] = 2; 
            DisablePlayerCheckpoint(playerid); 
            format(StartLoc, 50, LocalCargaDescarga[PlayerData[playerid][Carregamento]][NomedoLocal]); 
            format(EndLoc, 50, LocalCargaDescarga[PlayerData[playerid][Descarregamento]][NomedoLocal]); 
            format(Load, 50, ACargas[PlayerData[playerid][CargaID]][LoadName]); 
            x = LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocX]; 
            y = LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocY]; 
            z = LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocZ]; 
            SetPlayerCheckpoint(playerid, x, y, z, 7); 
            TogglePlayerControllable(playerid, 1); 
            SendClientMessageEx(playerid, -1, "Leve a carga de %s atй %s.", Load, EndLoc); 
        } 
        case 2: 
        { 
            new StartLoc[50], EndLoc[50], Load[50], Name[24]; 
            GetPlayerName(playerid, Name, sizeof(Name)); 
            format(StartLoc, 50, LocalCargaDescarga[PlayerData[playerid][Carregamento]][NomedoLocal]); 
            format(EndLoc, 50, LocalCargaDescarga[PlayerData[playerid][Descarregamento]][NomedoLocal]); 
            format(Load, 50, ACargas[PlayerData[playerid][CargaID]][LoadName]); 

            new Float:x1, Float:y1, Float:x2, Float:y2, Float:Distance, Message[128], Payment; 
            x1 = LocalCargaDescarga[PlayerData[playerid][Carregamento]][LocX]; 
            y1 = LocalCargaDescarga[PlayerData[playerid][Carregamento]][LocY]; 
            x2 = LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocX]; 
            y2 = LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocY]; 
            Distance = floatsqroot(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1))); 
            Payment = floatround((Distance * ACargas[PlayerData[playerid][CargaID]][PayPerUnit]), floatround_floor); 
            RewardPlayer(playerid, Payment); 
            
            PlayerData[playerid][pDentroCaminhao] = 0; 

            SendClientMessageEx(playerid, -1, "Vocк finalizou a entrega e ganhou R$%d.", Payment); 
            TogglePlayerControllable(playerid, 1); 
            Caminhoneiro_AcabouTrabalho(playerid); 
        } 
    } 
    return 1; 
}
Agora deu isso..

PHP код:
C:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(53522) : warning 204symbol is assigned a value that is never used"UnloadMsg"
C:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(53543) : warning 219local variable "SendClientMessage" shadows a variable at a preceding level
C
:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(53543) : warning 204symbol is assigned a value that is never used"SendClientMessage"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
3 Warnings

Reply
#10

Quote:
Originally Posted by willttoonn
Посмотреть сообщение
Tente:

Код:
forward Caminhoneiro_CarregarDesc(playerid); 
public Caminhoneiro_CarregarDesc(playerid) 
{ 
    switch (PlayerData[playerid][PartedoTrabalho]) 
    { 
        case 1: 
        { 
            new StartLoc[50], EndLoc[50], Load[50], Float:x, Float:y, Float:z, UnloadMsg[100]; 
            PlayerData[playerid][PartedoTrabalho] = 2; 
            DisablePlayerCheckpoint(playerid); 
            format(StartLoc, 50, LocalCargaDescarga[PlayerData[playerid][Carregamento]][NomedoLocal]); 
            format(EndLoc, 50, LocalCargaDescarga[PlayerData[playerid][Descarregamento]][NomedoLocal]); 
            format(Load, 50, ACargas[PlayerData[playerid][CargaID]][LoadName]); 
            x = LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocX]; 
            y = LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocY]; 
            z = LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocZ]; 
            SetPlayerCheckpoint(playerid, x, y, z, 7); 
            TogglePlayerControllable(playerid, 1); 
            SendClientMessageEx(playerid, -1, "Leve a carga de %s atй %s.", Load, EndLoc); 
        } 
        case 2: 
        { 
            new StartLoc[50], EndLoc[50], Load[50], Name[24]; 
            GetPlayerName(playerid, Name, sizeof(Name)); 
            format(StartLoc, 50, LocalCargaDescarga[PlayerData[playerid][Carregamento]][NomedoLocal]); 
            format(EndLoc, 50, LocalCargaDescarga[PlayerData[playerid][Descarregamento]][NomedoLocal]); 
            format(Load, 50, ACargas[PlayerData[playerid][CargaID]][LoadName]); 

            new Float:x1, Float:y1, Float:x2, Float:y2, Float:Distance, Message[128], Payment; 
            x1 = LocalCargaDescarga[PlayerData[playerid][Carregamento]][LocX]; 
            y1 = LocalCargaDescarga[PlayerData[playerid][Carregamento]][LocY]; 
            x2 = LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocX]; 
            y2 = LocalCargaDescarga[PlayerData[playerid][Descarregamento]][LocY]; 
            Distance = floatsqroot(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1))); 
            Payment = floatround((Distance * ACargas[PlayerData[playerid][CargaID]][PayPerUnit]), floatround_floor); 
            RewardPlayer(playerid, Payment); 
            
            PlayerData[playerid][pDentroCaminhao] = 0; 

            SendClientMessageEx(playerid, -1, "Vocк finalizou a entrega e ganhou R$%d.", Payment); 
            TogglePlayerControllable(playerid, 1); 
            Caminhoneiro_AcabouTrabalho(playerid); 
        } 
    } 
    return 1; 
}
Desnecessбrio colocar o "Ex" no SendClientMessage, atй entгo a funзгo jб estб para o playerid.

Sinceramente, nгo vejo motivos para o seu compilador estб dando warning no "SendClientMessage", funзгo estб certa. Veja se no topo da sua GM tem:
PHP код:
#pragma tabsize 0 
, ajuda melhor a compilaзгo.
Reply


Forum Jump:


Users browsing this thread: