Some stupid errors, need a help
#1

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
Reply
#2

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
Reply
#3

Same Errors
Reply
#4

any ideas ??
Reply
#5

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

Parameters should be exactly the same.
Reply
#6

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

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?
Reply
#8

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) ?
Reply
#9

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
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)