[Problema] Ysi
#1

Buenas, mi problema es este:
pawn Код:
C:\Users\Rodrigo\Desktop\SAMP\***\pawno\include\YSI\y_hooks/impl.inc(1755) : error 025: function heading differs from prototype
C:\Users\Rodrigo\Desktop\SAMP\***\pawno\include\YSI\y_hooks/impl.inc(2339) : error 025: function heading differs from prototype
C:\Users\Rodrigo\Desktop\SAMP\***\pawno\include\YSI\y_hooks/impl.inc(2386) : error 025: function heading differs from prototype
C:\Users\Rodrigo\Desktop\SAMP\***\filterscripts\Offline.pwn(158) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
el codigo es este:
pawn Код:
/*=========================================================================
      -------------------------------------------------------------------------
    *************Off-Line Message/Cash Sender By Zeus aka. BroZeus*************

      Current Version:- v1.0

      Credits--
      YSI aka Cole Miner     :For y_ini include and isnumeric stock and for sscanf2   [<--He is always there :D]
      Zeex                   :For ZCMD
      David Weston           :For strlib.inc
      Whole SAMP Team        :For SAMP and PAWNO compiler                             [ofc This credit would be alwasy there]
      Zeus aka BroZeus       :For scripting of this FS

    Avalable commands:--
    /sendcash      ---For sending offline message/cash
    /sendmes       ---Same as /sendcash
    /trans         ---For seeing received messages [Read messages=Green in color and UNREAD messages = orange in color]

    *******************DO NOT REMOVE CREDITS OR REDISTRUBATE*******************
    ----------------------------------------------------------------------------
    ===========================================================================*/


    #include <a_samp>
    #include <YSI\y_ini>
    #include <zcmd>
    #include <sscanf2>
    #include <strlib>
    /*======================*/
    #define USER_PATH "LARP/Users/%s.ini"//specifies the user path which your server uses
    /*======================*/
    #define D_SendCash1   500//the dialogs and there id edit thier id's as per as your use DONT CHANGE THERE NAMES ONLY EDIT ID's
    #define D_MainMes     501
    #define D_ConfirmMes  502
    #define D_Transfers   503
    #define D_InputBox    504
    /*======================*/
    #define MESP "/Transfers/%s.ini"
    /*======================*/
    enum mInfo
    {
    Sender[MAX_PLAYER_NAME],
    Reciver[MAX_PLAYER_NAME],
    Subject[50],
    Amount,
    line1[100],
    line2[100],
    IsRead,
    msgn,
    newmsg
    }
    new MesInfo[MAX_PLAYERS][mInfo];
    new Inpu[MAX_PLAYERS],tg[10];
    /*=================================================================*/
    forward LoadMNO_MNO(playerid,name[],value[]);
    public LoadMNO_MNO(playerid,name[],value[])
    {
    INI_Int("msg_numbers", MesInfo[playerid][msgn]);
    INI_Int("NewMsg", MesInfo[playerid][newmsg]);
    return 1;
    }
    /*==================================================================*/

    stock ReadWithTag(playerid,path[],tag[])//this stock made by me [ZEUS}  ;-)
    {
    new line[50],sqtag[12],sr=0,ide[15],val[21],lir=0;
    format(sqtag,12,"[%s]",tag);
    new File:Fi=fopen(path,io_read);
    while(fread(Fi,line))
    {

    if(!strfind(line, sqtag, true))sr=1;
    if(sr==1)
    {
    lir++;
    sscanf(line,"p<=>s[15]s[21]",ide,val);
    if(lir==2)format(MesInfo[playerid][Reciver],MAX_PLAYER_NAME,"%s",str_replace("\n","",val));
    if(lir==3)format(MesInfo[playerid][Sender],MAX_PLAYER_NAME,"%s",str_replace("\n","",val));
    if(lir==4)format(MesInfo[playerid][Subject],MAX_PLAYER_NAME,"%s",str_replace("\n","",val));
    if(lir==5)MesInfo[playerid][Amount]=strval(str_replace("\n","",val));
    if(lir==6)format(MesInfo[playerid][line1],MAX_PLAYER_NAME,"%s",str_replace("\n","",val));
    if(lir==7)format(MesInfo[playerid][line2],MAX_PLAYER_NAME,"%s",str_replace("\n","",val));
    if(lir==8)MesInfo[playerid][IsRead]=strval(str_replace("\n","",val));
    }
    if(lir==8)break;
    }
    fclose(Fi);
    sr = 0;lir=0;
    return 1;
    }



    stock UserPath(Reciverr[])
    {
    new string[MAX_PLAYER_NAME+20];
    format(string,sizeof(string),USER_PATH,Reciverr);
    return string;
    }

    stock MesPath(Reciverm[])
    {
    new string[MAX_PLAYER_NAME+20];
    format(string,sizeof(string),MESP,Reciverm);
    return string;
    }

    stock isnum(str[])//by YSI taken from y_utils
    {
            new ch,i;
            while ((ch = str[i++])) if (!('0' <= ch <= '9')) return 0;
            return 1;
    }

    stock ShowMes(playerid)
    {
    new str[250];
    format(str,sizeof(str),"{00FFFF}Reciver:\t\t{54C571}%s\n{00FFFF}Subject:\t\t{54C571}%s\n{00FFFF}Amount:\t\t{4E9258}$%i\n{00FFFF}Detail[Line1]:\t\t{54C571}%s\n{00FFFF}Detail[Line2]:\t\t{54C571}%s\n{E3E4FA}Send!",
    MesInfo[playerid][Reciver],
    MesInfo[playerid][Subject],
    MesInfo[playerid][Amount],
    MesInfo[playerid][line1],
    MesInfo[playerid][line2]);
    ShowPlayerDialog(playerid,D_SendCash1,DIALOG_STYLE_LIST,"{842DCE}Send Message",str,"Select","Cancel");
    }
    /*================================================================*/
    public OnPlayerSpawn(playerid)
    {
    new named[MAX_PLAYER_NAME];
    GetPlayerName(playerid,named,MAX_PLAYER_NAME);
    INI_ParseFile(MesPath(named), "LoadMNO_%s", .bExtra = true, .extra = playerid);
    if(MesInfo[playerid][newmsg]>=1)
    {
    new st[300];
    format(st,sizeof(st),"{00FFFF}You have received {ff0000}%i {00FFFF}new offline messages. Please do {ff0000}/trans {00FFFF}to see it/them.",MesInfo[playerid][newmsg]);
    SendClientMessage(playerid,-1,st);
    }
    return 1;
    }

    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {

    switch(dialogid)
    {
    case D_SendCash1:
    {
    if(response){
    switch(listitem)
    {
    case 0:{ShowPlayerDialog(playerid,D_InputBox,DIALOG_STYLE_INPUT,"{842DCE}Reciver","{B93B8F}Enter the name of player whihc you want to send the message to.","OK","Back");Inpu[playerid]=1;}
    case 1:{ShowPlayerDialog(playerid,D_InputBox,DIALOG_STYLE_INPUT,"{842DCE}Subject","{B93B8F}Enter the subject of the transfer message.","OK","Back");Inpu[playerid]=2;}
    case 2:{ShowPlayerDialog(playerid,D_InputBox,DIALOG_STYLE_INPUT,"{842DCE}Amount","{B93B8F}Enter the amount you want to send.","OK","Back");Inpu[playerid]=3;}
    case 3:{ShowPlayerDialog(playerid,D_InputBox,DIALOG_STYLE_INPUT,"{842DCE}Details[Line 1/2]","{B93B8F}Enter some description about the message.\n\nNOTE:Maximum characters 20.","OK","Back");Inpu[playerid]=4;}
    case 4:{ShowPlayerDialog(playerid,D_InputBox,DIALOG_STYLE_INPUT,"{842DCE}Details[Line 2/2]","{B93B8F}Enter some description about the message.\n\nNOTE:Maximum characters 20.","OK","Back");Inpu[playerid]=5;}
    case 5:{new str[250];
    format(str,sizeof(str),"{00FFFF}Reciver:\t\t{54C571}%s\n{00FFFF}Subject:\t\t{54C571}%s\n{00FFFF}Amount:\t\t{4E9258}$%i\n{00FFFF}Detail[Line1]:\t\t{54C571}%s\n{00FFFF}Detail[Line2]:\t\t{54C571}%s\n\n{ff0000}NOTE:Clicking on confirmation will send the message.",
    MesInfo[playerid][Reciver],
    MesInfo[playerid][Subject],
    MesInfo[playerid][Amount],
    MesInfo[playerid][line1],
    MesInfo[playerid][line2]);
    ShowPlayerDialog(playerid,D_ConfirmMes,DIALOG_STYLE_MSGBOX,"{842DCE}Confirmation",str,"Confirm","Back");
    }
    }
    }
    }

    /*..............*/
    case D_InputBox:
    {
    if(response)
    {
    switch(Inpu[playerid])
    {
    case 1:{
    if(!fexist(UserPath(inputtext)))
    {SendClientMessage(playerid,-1,"{ff0000}There is no such user");ShowMes(playerid);}
    else
    {format(MesInfo[playerid][Reciver],MAX_PLAYER_NAME,"%s",inputtext);ShowMes(playerid);}
    }
    case 2:{
    if(strlen(inputtext)>10)
    {SendClientMessage(playerid,-1,"{ff0000}Subject should not be more than 10 characters.");ShowMes(playerid);}
    else
    {format(MesInfo[playerid][Subject],MAX_PLAYER_NAME,"%s",inputtext);ShowMes(playerid);}
    }
    case 3:{
    if(!isnum(inputtext)){SendClientMessage(playerid,-1,"{ff0000}Enter a numerical value.");ShowMes(playerid);}
    else if(strval(inputtext)>GetPlayerMoney(playerid)){SendClientMessage(playerid,-1,"{ff0000}Not enough money.");ShowMes(playerid);}
    else {MesInfo[playerid][Amount]=strval(inputtext);ShowMes(playerid);}
    }
    case 4:{
    if(strlen(inputtext)>20)
    {SendClientMessage(playerid,-1,"{ff0000}Description should not be more than 20 characters.");ShowMes(playerid);}
    else
    {format(MesInfo[playerid][line1],20,"%s",inputtext);ShowMes(playerid);}
    }
    case 5:{
    if(strlen(inputtext)>20)
    {SendClientMessage(playerid,-1,"{ff0000}Description should not be more than 20 characters.");ShowMes(playerid);}
    else
    {format(MesInfo[playerid][line2],20,"%s",inputtext);ShowMes(playerid);}
    }
    }
    }
    else ShowMes(playerid);
    }
    /*......................*/
    case D_ConfirmMes:
    {
    if(response)
    {
    if(!strcmp(MesInfo[playerid][Reciver],"{ff0000}---",false) || !strcmp(MesInfo[playerid][Subject],"{ff0000}---",false))
    {
    SendClientMessage(playerid,-1,"{ff0000}The field of either Reciver or Subject is missing please fill them up.");
    ShowMes(playerid);
    }
    else
    {
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
    GivePlayerMoney(playerid,-MesInfo[playerid][Amount]);
    if(!fexist(MesPath(MesInfo[playerid][Reciver])))//that is if its recivers first message
    {
    new INI:iFile = INI_Open(MesPath(MesInfo[playerid][Reciver]));
    INI_SetTag(iFile,"MNO");//contain the varable to store number of messages received by player :)
    INI_WriteInt(iFile,"msg_numbers",1);//the varaible storing the no. of messages
    INI_WriteInt(iFile,"NewMsg",1);
    INI_SetTag(iFile,"msg1");
    INI_WriteString(iFile,"Reciver",MesInfo[playerid][Reciver]);
    INI_WriteString(iFile,"Sender",pname);
    INI_WriteString(iFile,"Subject",MesInfo[playerid][Subject]);
    INI_WriteInt(iFile,"Amount",MesInfo[playerid][Amount]);
    INI_WriteString(iFile,"line1",MesInfo[playerid][line1]);
    INI_WriteString(iFile,"line2",MesInfo[playerid][line2]);
    INI_WriteInt(iFile,"IsRead",0);
    INI_Close(iFile);
    }
    else
    {
    INI_ParseFile(MesPath(MesInfo[playerid][Reciver]), "LoadMNO_%s", .bExtra = true, .extra = playerid);
    new Xtag[10];
    format(Xtag,10,"msg%i",MesInfo[playerid][msgn]+1);
    new INI:iFile = INI_Open(MesPath(MesInfo[playerid][Reciver]));
    INI_SetTag(iFile,"MNO");
    INI_WriteInt(iFile,"msg_numbers",MesInfo[playerid][msgn]+1);
    INI_WriteInt(iFile,"NewMsg",MesInfo[playerid][newmsg]+1);
    INI_SetTag(iFile,Xtag);
    INI_WriteString(iFile,"Reciver",MesInfo[playerid][Reciver]);
    INI_WriteString(iFile,"Sender",pname);
    INI_WriteString(iFile,"Subject",MesInfo[playerid][Subject]);
    INI_WriteInt(iFile,"Amount",MesInfo[playerid][Amount]);
    INI_WriteString(iFile,"line1",MesInfo[playerid][line1]);
    INI_WriteString(iFile,"line2",MesInfo[playerid][line2]);
    INI_WriteInt(iFile,"IsRead",0);
    INI_Close(iFile);
    }
    SendClientMessage(playerid,-1,"{00FF00}Message sent!!");
    }
    }
    else ShowMes(playerid);
    }
    /*..............................*/
    case D_Transfers:
    {
    if(response)
    {
    new tag[10],name[MAX_PLAYER_NAME],str[300];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    format(tag,sizeof(tag),"msg%i",listitem+1);
    ReadWithTag(playerid,MesPath(name),tag);
    if(MesInfo[playerid][IsRead]==0)
    {
    GivePlayerMoney(playerid,MesInfo[playerid][Amount]);
    if(MesInfo[playerid][Amount]>0)SendClientMessage(playerid,-1,"{00cc00}Money received from message.");
    new INI:File=INI_Open(MesPath(name));
    INI_SetTag(File,"MNO");
    INI_WriteInt(File,"NewMsg",MesInfo[playerid][Amount]-1);
    INI_SetTag(File,tag);
    INI_WriteInt(File,"IsRead",1);
    INI_Close(File);
    }
    format(str,sizeof(str),"{00FFFF}Sender:\t\t{54C571}%s\n{00FFFF}Subject:\t\t{54C571}%s\n{00FFFF}Amount:\t\t{4E9258}$%i\n{00FFFF}Detail[Line1]:\t\t{54C571}%s\n{00FFFF}Detail[Line2]:\t\t{54C571}%s\n\n{ff0000}===================================",
    MesInfo[playerid][Sender],
    MesInfo[playerid][Subject],
    MesInfo[playerid][Amount],
    MesInfo[playerid][line1],
    MesInfo[playerid][line2]);
    ShowPlayerDialog(playerid,D_MainMes,DIALOG_STYLE_MSGBOX,"{842DCE}Message",str,"Cool","Cancel");
    }
    }
    }
    }





    /*=============================COMMANDS========================COMMANDS=========================COMMANDS=============================*/
    CMD:sendcash(playerid,params[])
    {
    format(MesInfo[playerid][Reciver],MAX_PLAYER_NAME,"{ff0000}---");
    format(MesInfo[playerid][Subject],MAX_PLAYER_NAME,"{ff0000}---");
    MesInfo[playerid][Amount]=0;
    format(MesInfo[playerid][line1],MAX_PLAYER_NAME,"{ff0000}---");
    format(MesInfo[playerid][line2],MAX_PLAYER_NAME,"{ff0000}---");
    ShowMes(playerid);
    return 1;
    }

    CMD:sendmes(playerid,params[])
    {
    cmd_sendcash(playerid,params);
    return 1;
    }


    CMD:trans(playerid,params[])
    {

    new named[MAX_PLAYER_NAME];
    GetPlayerName(playerid,named,sizeof(named));
    if(!fexist(MesPath(named)))return SendClientMessage(playerid,-1,"{C58917}No Off-Line Messages currently recieved.");
    INI_ParseFile(MesPath(named), "LoadMNO_%s", .bExtra = true, .extra = playerid);
    SendClientMessage(playerid,-1,"{00FFFF}NOTE : {F87217}ORANGE{00FFFF} messages = Unread messages & {00cc00}GREEN {00FFFF}messages = Read Messages");
    new sho[500],i,col[50];
    format(sho,500,"");
    for(i=1;i<=MesInfo[playerid][msgn];i++)
    {
    format(tg,10,"msg%i",i);
    ReadWithTag(playerid,MesPath(named),tg);
    if(MesInfo[playerid][IsRead]==0)format(col,sizeof(col),"{F87217}%s: %s\n",MesInfo[playerid][Sender],MesInfo[playerid][Subject]);
    else format(col,sizeof(col),"{00cc00}%s: %s\n",MesInfo[playerid][Sender],MesInfo[playerid][Subject]);
    strcat(sho,col,sizeof(sho));
    }
    ShowPlayerDialog(playerid,D_Transfers,DIALOG_STYLE_LIST,"{842DCE}Offline Transfers",sho,"Read","Cancel");
    return 1;
    }

Segъn tengo entendido es porque esta desactualizado el codigo con las funciones de la versiуn 3.1 de Ysi (0.3x), Gracнas de ante-mano.
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=488198
Reply
#3

actualmente eh tenido estos problema, pero eh actualizado la versiуn del YSI y me ha copilado!
Reply
#4

Estoy usando la versiуn 3.1, hice lo que decia en la Guнa que posteaste [J]ulian y me salta esto:
pawn Код:
C:\Users\Rodrigo\Desktop\SAMP\***\pawno\include\YSI\y_hooks/impl.inc(2336) : error 025: function heading differs from prototype
C:\Users\Rodrigo\Desktop\SAMP\***\pawno\include\YSI\y_hooks/impl.inc(2383) : error 025: function heading differs from prototype
C:\Users\Rodrigo\Desktop\SAMP\***\filterscripts\Offline.pwn(158) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)