SA-MP Forums Archive
Some stupid errors, need a help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Some stupid errors, need a help (/showthread.php?tid=448923)



Some stupid errors, need a help - Yordan_Kronos - 06.07.2013

Hello Today i update my YSI with latest Files and when i add it like #Include in my Gamemode i have this error :

This is my Gamemode Include's line :
pawn Код:
#include <a_samp>
#include <Dini>
#include <streamer>
#include <foreach>
#define MODE_NAME "BG RC RP 1"
#include <YSI\y_svar>
static gTeam[MAX_PLAYERS];
pawn Код:
(174)error 025: function heading differs from prototype
pawn Код:
(15002)error 035: argument type mismatch (argument 2)
pawn Код:
(15064)error 035: argument type mismatch (argument 2)
pawn Код:
(15128)error 035: argument type mismatch (argument 2)
pawn Код:
(25194)error 035: argument type mismatch (argument 2)
pawn Код:
forward split(const strsrc[], strdest[][], delimiter);//172
forward OnPlayerRegister(playerid, password[]);//173
forward OnPlayerLogin(playerid, password[]);//174
forward OnPlayerDataSave(playerid);//175
pawn Код:
new tmppass[64];//15001
OnPlayerLogin(playerid,tmppass);//15002
pawn Код:
public OnPlayerLogin(playerid, uid)//15059
{//15060
    new string2[256], keystring[256];//15061
    format(string2, sizeof(string2), "%s.ini", PlayerName(playerid));//15062
    keystring = dini_Get(string2, "Key");//15063
    if(strcmp(keystring, uid, true) == 0)//15064
    {//15065
pawn Код:
SendClientMessage(playerid, COLOR_WHITE,string2);//15126
    GetPlayerIp(playerid, PlayerInfo[playerid][pIP], 21);//15127
    strmid(PlayerInfo[playerid][pKey], uid, 0, strlen(password), 255);//15128
pawn Код:
new tmp[64];//25192
                strmid(tmp, inputtext, 0, strlen(inputtext), 255);//25193
                OnPlayerLogin(playerid,tmp);//25194
Please help me to fix it. I trying all day


Re : Some stupid errors, need a help - Chadi - 06.07.2013

new tmppass[64];//15001
OnPlayerLogin(playerid,tmppass[64]);//15002

public OnPlayerLogin(playerid, uid[])//15059
{//15060
new string2[256], keystring[256];//15061
format(string2, sizeof(string2), "%s.ini", PlayerName(playerid));//15062
keystring = dini_Get(string2, "Key");//15063
if(strcmp(keystring, uid, true) == 0)//15064
{//1506


Re: Some stupid errors, need a help - Yordan_Kronos - 06.07.2013

Same Errors


Re: Some stupid errors, need a help - Yordan_Kronos - 06.07.2013

any ideas ??


Re: Some stupid errors, need a help - Konstantinos - 06.07.2013

pawn Код:
forward OnPlayerLogin(playerid, password[]);
public OnPlayerLogin(playerid, uid)
Like the error says "function heading differs from prototype"

Parameters should be exactly the same.


Re: Some stupid errors, need a help - Yordan_Kronos - 06.07.2013

How must to be homie ? Do you can help me, i really need from that


Re: Some stupid errors, need a help - Konstantinos - 06.07.2013

It depends on what you want to do.

Use either:

pawn Код:
forward OnPlayerLogin(playerid, password[]);
public OnPlayerLogin(playerid, password[])
or:

pawn Код:
forward OnPlayerLogin(playerid, uid);
public OnPlayerLogin(playerid, uid)
However, in some cases you enter as second parameter string and somewhere else an integer. What do you want? It must be one of them.

In this line "if(strcmp(keystring, uid, true) == 0)" you check if an integer is equal to a string and that's why it gives you an error.

Was uid supposed to be the "password" of the player?


Re: Some stupid errors, need a help - Yordan_Kronos - 06.07.2013

Yes i fixed first error with this
pawn Код:
forward OnPlayerLogin(playerid, uid);
public OnPlayerLogin(playerid, uid)
and yes Uid is my Password, so how can i fix others error : argument type mismatch (argument 2) ?


Re: Some stupid errors, need a help - Konstantinos - 06.07.2013

From what I see, your password should be a string and not a number.

Switch to:
pawn Код:
forward OnPlayerLogin(playerid, password[]);
public OnPlayerLogin(playerid, password[])
pawn Код:
new tmppass[64];
// assign the password
OnPlayerLogin(playerid,tmppass);// It won't give arror anymore, since you parse a string in it.
pawn Код:
public OnPlayerLogin(playerid, password[])
{
    new string2[256], keystring[256];
    format(string2, sizeof(string2), "%s.ini", PlayerName(playerid));
    keystring = dini_Get(string2, "Key");
    if(strcmp(keystring, password, true) == 0) // I assume that's the password check string1 is equal to string2
    {
pawn Код:
new tmp[64];
strmid(tmp, inputtext, 0, strlen(inputtext), 255);
OnPlayerLogin(playerid,tmp);// Insert a string will prevent the error



Re: Some stupid errors, need a help - Yordan_Kronos - 06.07.2013

Again same error, 4 people tried to fix this but they failed.. I dont know where is this error and how to fix. I Ask ****** but he silent. Thanks for your time, i'll give you reputation after 24 hours.