Hello another question I got in my mind..
#1

How I could make dna system so player gets unique dna?

It could be something like random nummbers or?
Like groups A+ A- with random nummber by player?
Reply
#2

random(valuehere);

pawn Код:
new PlayerDNA[MAX_PLAYERS]; // the variable of choice
//this is only if u havent sign a value yet
// this is how to assign a value randomly
stock DNA(playerid)
{
   new pDNA;
   pDNA =  1 + random(6);
   if(pDNA == 1)
   if(pDNA == 2)
   if(pDNA == 3)
   if(pDNA == 4)
   if(pDNA == 5)
   if(pDNA == 6)
   PlayerDNA[playerid] = pDNA;
   return pDNA;
}

stock DNATYPE(playerid)
{
   new Type[32];
   if(PlayerDNA[playerid] == 1) format(Type, sizeof(Type), "A+");
   else if(PlayerDNA[playerid] == 2) format(Type, sizeof(Type), "A-");
   else if(PlayerDNA[playerid] == 3) format(Type, sizeof(Type), "B+");
   else if(PlayerDNA[playerid] == 4) format(Type, sizeof(Type), "B-");
   else if(PlayerDNA[playerid] == 5) format(Type, sizeof(Type), "C+");
   else if(PlayerDNA[playerid] == 6) format(Type, sizeof(Type), "C-");
   return Type;
}

// Yes i know those aren't actually DNA's Is an example

//using ZCMD
CMD:mydna(playerid, params[])
{
    new string[256];
    format(string, 256, "Your DNA Type: %s", DNATYPE(playerid));
    SendClientMessage(playerid, -1, string);
    return 1;
}
Reply
#3

You're confusing DNA with blood type.

If you want a unique number to represent players' DNA, and you're using mySQL to save player data, use the primary id key (which you SHOULD be using already). If you don't want the DNA 'IDs' to start at 0/1 just add x to it.

If you want BLOOD types, just define them like he said.
Reply
#4

Just thought like blood type and dna.. Sorry about mixing them..

Just making reallistic roleplay thats why was same about DNA and Blood type..

I'm using y_ini...

So basically yeah better start with nummbers I think!

Big thanks Glad2BeHere..
Again you gived me an idea about that Howit works..

Another question to Glad2BeHere it will work for all players as random nummbers right?
Reply
#5

I'll say it again: Blood type IS NOT the same thing as DNA. Everyone's DNA is unique (excluding identical twins), whereas there are only a few (~6) blood types.

By not specifying which you want, it's hard to help, because they're VERY different.
Reply
#6

You see I want just dna system.. I don't know how big would be dna code?

Yeah sorry about my miss understanding what I'm making right now ..

It's for police investigation systems.
Reply
#7

Dude, did you know one human DNA uses 37MB of HDD, are you sure you want to make that sys... LOL just kidding, my advice is to use as MP2 said, MySQL with primary key ID that is Auto increment, or just generate UniqueID, but that is not necessary cus ID is already unique.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)