[AJUDA]erros no /cinto e /tirarcinto
#1

boas apareceume este erro

Quote:

C:\Users\Ricardo\Desktop\Server Sa-mp 0.3c\filterscripts\Cinto.pwn(52) : error 017: undefined symbol "string"
C:\Users\Ricardo\Desktop\Server Sa-mp 0.3c\filterscripts\Cinto.pwn(52) : error 017: undefined symbol "string"
C:\Users\Ricardo\Desktop\Server Sa-mp 0.3c\filterscripts\Cinto.pwn(52) : error 029: invalid expression, assumed zero
C:\Users\Ricardo\Desktop\Server Sa-mp 0.3c\filterscripts\Cinto.pwn(52) : fatal error 107: too many error messages on one line

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


4 Errors.

Linha 52:
Quote:

format(string, sizeof(string), "* %s mete o cinto de seguranзa.", sendername);

Reply
#2

new string[256];
Reply
#3

colocu isso no topo do filterscript ?
Reply
#4

aparece isto agora, mas eu quero tb tirar os vvarings


Quote:

C:\Users\Ricardo\Desktop\Server Sa-mp 0.3c\filterscripts\Cinto.pwn(51) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Ricardo\Desktop\Server Sa-mp 0.3c\filterscripts\Cinto.pwn(54) : error 017: undefined symbol "sendername"
C:\Users\Ricardo\Desktop\Server Sa-mp 0.3c\filterscripts\Cinto.pwn(55) : error 017: undefined symbol "ProxDetector"
C:\Users\Ricardo\Desktop\Server Sa-mp 0.3c\filterscripts\Cinto.pwn(61) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Ricardo\Desktop\Server Sa-mp 0.3c\filterscripts\Cinto.pwn(63) : error 017: undefined symbol "RED"
C:\Users\Ricardo\Desktop\Server Sa-mp 0.3c\filterscripts\Cinto.pwn(64) : error 017: undefined symbol "sendername"
C:\Users\Ricardo\Desktop\Server Sa-mp 0.3c\filterscripts\Cinto.pwn(65) : error 017: undefined symbol "ProxDetector"
C:\Users\Ricardo\Desktop\Server Sa-mp 0.3c\filterscripts\Cinto.pwn(72) : warning 203: symbol is never used: "string"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.

Reply
#5

Bota isso em cima do format.
Reply
#6

o meu [FS] nao tem isso xD e pequenino


Quote:
pawn Код:
//••••••••••••••••••••••••••••••••••••••••••••••••••••
//••
#include <a_samp>
#define MEUS_SLOTS 20
//************ Cores **************************
#define AMARELO          0xFFFF00AA
#define VERDE        0x33AA33A
#define COLOR_RED 0xAA3333AA
//********** Arrays ***************************
new CintoPlayer[MEUS_SLOTS];
new string[256];
//***************** CallBakcs (Detectar Batida *****************
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
    if(CintoPlayer[playerid] == 0)
    {
    new Float:Px = 0.000000, Float:Py = 0.000000, Float:Pz = 0.000000, Float:Pa = 0.000000, Float:HV ;
    GetPlayerPos(playerid, Px, Py, Pz);//PEGA POS
    GetPlayerFacingAngle(playerid, Pa);//PEGA ANGULO
    GetVehicleHealth(vehicleid,HV);
    SetPlayerHealth(playerid,HV/70);
    SetPlayerPos(playerid,Px+2,Py+2,Pz+1);
    RemovePlayerFromVehicle(playerid);//REMOVE VEICULO
    ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
    ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
    SendClientMessage(playerid,AMARELO,"");
    SetTimer("ANIM",5000,0);
    SetPlayerWantedLevel(playerid, 1);
    }
    return 1;
}
//************ CallBacks Para Anims **************************
forward ANIM(playerid);
public ANIM(playerid)
{
    ClearAnimations(playerid);
    return 1;
}
//*************** Call Backs Entra Veiculos ******************
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    CintoPlayer[playerid] = 0;
    SendClientMessage(playerid,COLOR_RED,"Vocк estб sem cinto.");
    return 1;
}
//******** Call Backs Comandos *******************************
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/cinto", true))
    {
    new string[256];
    CintoPlayer[playerid] = 1;
    SendClientMessage(playerid,VERDE,"Vocк meteu o cinto de seguranзa, agora estб protegido dos acidentes.");
    format(string, sizeof(string), "* %s mete o cinto de seguranзa.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    SetPlayerWantedLevel(playerid, 0);
    return 1;
    }
    if(!strcmp(cmdtext, "/tirarcinto", true))
    {
    new string[256];
    CintoPlayer[playerid] = 0;
    SendClientMessage(playerid,RED,"Vocк tirou o cinto de seguranзa, cuidado com a policia.");
    format(string, sizeof(string), "* %s tira o cinto de seguranзa.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    SetPlayerWantedLevel(playerid, 0);
    return 1;
    }
    return 0;
}
//*************** The End *************************************
Reply
#7

arrumei o fs pra vc, faltava dois new sendername[24]; duas cores e a funзгo proxdetector.
pawn Код:
//••••••••••••••••••••••••••••••••••••••••••••••••••••
//••
#include <a_samp>
#define MEUS_SLOTS 20
//************ Cores **************************
#define AMARELO          0xFFFF00AA
#define VERDE        0x33AA33A
#define COLOR_RED 0xAA3333AA
#define RED 0xAA3333AA
#define COLOR_PURPLE 0x990099AA
//********** Arrays ***************************
new CintoPlayer[MEUS_SLOTS];
//***************** CallBakcs (Detectar Batida *****************
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
    if(CintoPlayer[playerid] == 0)
    {
    new Float:Px = 0.000000, Float:Py = 0.000000, Float:Pz = 0.000000, Float:Pa = 0.000000, Float:HV ;
    GetPlayerPos(playerid, Px, Py, Pz);//PEGA POS
    GetPlayerFacingAngle(playerid, Pa);//PEGA ANGULO
    GetVehicleHealth(vehicleid,HV);
    SetPlayerHealth(playerid,HV/70);
    SetPlayerPos(playerid,Px+2,Py+2,Pz+1);
    RemovePlayerFromVehicle(playerid);//REMOVE VEICULO
    ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
    ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
    SendClientMessage(playerid,AMARELO,"");
    SetTimer("ANIM",5000,0);
    SetPlayerWantedLevel(playerid, 1);
    }
    return 1;
}
//************ CallBacks Para Anims **************************
forward ANIM(playerid);
public ANIM(playerid)
{
    ClearAnimations(playerid);
    return 1;
}
//*************** Call Backs Entra Veiculos ******************
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    CintoPlayer[playerid] = 0;
    SendClientMessage(playerid,COLOR_RED,"Vocк estб sem cinto.");
    return 1;
}
//******** Call Backs Comandos *******************************
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/cinto", true))
    {
    new sendername[24];
    new string[256];
    CintoPlayer[playerid] = 1;
    SendClientMessage(playerid,VERDE,"Vocк meteu o cinto de seguranзa, agora estб protegido dos acidentes.");
    format(string, sizeof(string), "* %s mete o cinto de seguranзa.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    SetPlayerWantedLevel(playerid, 0);
    return 1;
    }
    if(!strcmp(cmdtext, "/tirarcinto", true))
    {
    new sendername[24];
    new string[256];
    CintoPlayer[playerid] = 0;
    SendClientMessage(playerid,RED,"Vocк tirou o cinto de seguranзa, cuidado com a policia.");
    format(string, sizeof(string), "* %s tira o cinto de seguranзa.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    SetPlayerWantedLevel(playerid, 0);
    return 1;
    }
    return 0;
}
forward ProxDetector(Float:radi, playerid, str[], col1, col2, col3, col4, col5);

public ProxDetector(Float:radi, playerid, str[],col1,col2,col3,col4,col5)
{
    if(IsPlayerConnected(playerid))
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        //radi = 2.0; //Trigger Radius
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {

                GetPlayerPos(i, posx, posy, posz);
                tempposx = (oldposx -posx);
                tempposy = (oldposy -posy);
                tempposz = (oldposz -posz);
                //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
                if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
                {
                    SendClientMessage(i, col1, str);
                }
                else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
                {
                    SendClientMessage(i, col2, str);
                }
                else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
                {
                    SendClientMessage(i, col3, str);
                }
                else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
                {
                    SendClientMessage(i, col4, str);
                }
                else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
                {
                    SendClientMessage(i, col5, str);
                }
            }
        }
    }//not connected
    return 1;
}
//the end
faзa bom uso.
Reply
#8

Obrigado manu, agradeзo mesmo, fico te a dever uma
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)