Not generating BlodType...
#1

Hello dear samp members!

I need help with saving and generating code... Something ain't working well.
Need help about this code:

pawn Код:
stock Bloodtype(playerid)
{
   new pBloodtype;
   pBloodtype =  1 + random(6);
   if(pBloodtype == 1)
   if(pBloodtype == 2)
   if(pBloodtype == 3)
   if(pBloodtype == 4)
   if(pBloodtype == 5)
   if(pBloodtype == 6)
   PlayerInfo[playerid][BloodType] = pBloodtype;
   return pBloodtype;
}
stock BLOODTYPE(playerid)
{
   new Type[32];
   if(PlayerInfo[playerid][BloodType] == 1) format(Type, sizeof(Type), "A+");
   else if(PlayerInfo[playerid][BloodType] == 2) format(Type, sizeof(Type), "A-");
   else if(PlayerInfo[playerid][BloodType] == 3) format(Type, sizeof(Type), "B+");
   else if(PlayerInfo[playerid][BloodType] == 4) format(Type, sizeof(Type), "B-");
   else if(PlayerInfo[playerid][BloodType] == 5) format(Type, sizeof(Type), "C+");
   else if(PlayerInfo[playerid][BloodType] == 6) format(Type, sizeof(Type), "C-");
   return Type;
}

format(str, 128, "Your Blood Type: %s", BLOODTYPEd(playerid));
                SendClientMessage(playerid, 0x9cfc14FF, str);
Reply
#2

Well that is a bad way of checking for a variable.

Код:
format(str, 128, "Your Blood Type: %s", PlayerInfo[playerid][BloodType]) SendClientMessage(playerid, 0x9cfc14FF, str);
Reply
#3

Still the same thing.. But the thing is idk.. why it ain't saving and generating it...

Yeah I fixed it (thanks) But still idk why it ain't saving the type... (That "d" mistake at the end of bloodtype was just copy paste mistake)

Bodytype = 0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)