OnVehicleDeath Problem
#4

Quote:
Originally Posted by zT KiNgKoNg
Посмотреть сообщение
Okay it seems that the problem is after the if(slot > 0)

pawn Код:
stock AddUnderScoreToName(Name[]) { strreplace(Name, ' ', '_'); return Name; }

stock GetPlayerIDFromName(const playername[], partofname=0)
{
    new i;
    new playername1[64];
    for (i=0;i<MAX_PLAYERS;i++)
    {
        if (IsPlayerConnected(i))
        {
            GetPlayerName(i,playername1,sizeof(playername1));
            if (strcmp(playername1,playername,true)==0)
            {
                return i;
            }
        }
    }
    new correctsigns_userid=-1;
    new tmpuname[128];
    new hasmultiple=-1;
    if(partofname)
    {
        for (i=0;i<MAX_PLAYERS;i++)
        {
            if (IsPlayerConnected(i))
            {
                GetPlayerName(i,tmpuname,sizeof(tmpuname));

                if(!strfind(tmpuname,playername1[partofname],true, 0))
                {
                    hasmultiple++;
                    correctsigns_userid=i;
                }
                if (hasmultiple>0)
                {
                    return -2;
                }
            }
        }
    }
    return correctsigns_userid;
}
This code is not used for the slot value. Check the variables code VehicleInfo[slot][vInsurance] and print it out. The function you gave above is the ownerid, we don't need it as you said it returns a correct value.
Reply


Messages In This Thread
OnVehicleDeath Problem - by zT KiNgKoNg - 27.12.2013, 18:45
Re: OnVehicleDeath Problem - by Cypress - 27.12.2013, 19:37
Re: OnVehicleDeath Problem - by zT KiNgKoNg - 27.12.2013, 20:19
Re: OnVehicleDeath Problem - by Cypress - 27.12.2013, 21:40
Re: OnVehicleDeath Problem - by zT KiNgKoNg - 28.12.2013, 09:29

Forum Jump:


Users browsing this thread: 3 Guest(s)