SA-MP Forums Archive
Generating a Wolf Name [BUGGED] - 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: Generating a Wolf Name [BUGGED] (/showthread.php?tid=616084)



Generating a Wolf Name [BUGGED] - NealPeteros - 31.08.2016

Hi, guys! Tried to recreate VWH (Don't worry, I won't publicly give it, or start a server unless I get Rudy's permission), but I got a bug when generating a wolf name. Here's the code for it.

PHP код:
                    if(!UsedAnimation[playerid])
                    {
                        new 
string[MAX_PLAYER_NAME+14];
                        if(
PlayerInfo[playerid][pCall] > -1)
                        {
                            
string[0] = PlayerInfo[playerid][pCall];
                            
PlayerInfo[playerid][pCall] = -EXTERIOR;
                            
PlayerInfo[string[0]][pCall] = -EXTERIOR;
                            if(
GetPlayerSpecialAction(string[0]) == SPECIAL_ACTION_USECELLPHONE)
                            {
                                
SetPlayerSpecialAction(string[0], SPECIAL_ACTION_STOPUSECELLPHONE);
                            }
                            if(
GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USECELLPHONE)
                            {
                                
SetPlayerSpecialAction(playeridSPECIAL_ACTION_STOPUSECELLPHONE);
                            }
                        }
                        
format(string,sizeof(string),"UniqueIDs/ID_%06d.ini",PlayerInfo[playerid][pUniqueID]);
                        if(
Skills[playerid][SniperRifle] == 255)
                        {
                            
UsedAnimation[playerid] = true;
                            
SetTimerEx("AnimationCoolDown"1000false"i"playerid);
                            
PlayerActionMessageBubble(playerid"shapeshifts into the wolf form.");
                            
Skills[playerid][SniperRifle] = 511;
                            
SetPlayerSkin(playerid0);
                            
ResetPlayerWeapons(playerid);
                            
DOF2_GetStringEx(string"Wnm"stringsizeof(string), "General");
                            
SetPlayerName(playeridstring);
                            new 
Float:health 1.0;
                            
health 50.0 + (5.0 Skills[playerid][DesertEagle]);
                            new 
Float:healthex 1.0;
                            
GetPlayerHealth(playeridhealthex);
                            if(
healthex health)
                            {
                                
SetPlayerHealth(playeridhealth);
                            }
                            
SetPlayerFightingStyle(playeridFIGHT_STYLE_BOXING);
                            
SetPlayerColor(playeridCOLOR_WEREWOLF);
                            
TogglePlayerControllable(playeridtrue);
                            for(new 
iMAX_PLAYER_ATTACHED_ACCSSORIES+PlayerInfo[playerid][pDonator]+1i++)
                            {
                                
RemovePlayerAttachedObject(playeridi);
                            }
                        }
                        else
                        {
                            
PlayerActionMessageBubble(playerid"shapeshifts into the human form.");
                            
UsedAnimation[playerid] = true;
                            
SetTimerEx("AnimationCoolDown"1000false"i"playerid);
                            
Skills[playerid][SniperRifle] = 255;
                              
DOF2_GetStringEx(string,"Nme",string,sizeof(string),"General");//(file[],key[],result[],size,tag[]="");
                              
SetPlayerName(playeridstring);
                            
format(string,sizeof(string),"Accounts/%s.ini",string);
                            
SetPlayerSkin(playeridDOF2_GetInt(string,"Skn","General"));
                            
SetPlayerFightingStyle(playeridFIGHT_STYLE_GRABKICK);
                            
SetPlayerColor(playeridCOLOR_NEUTRAL);
                            
TogglePlayerControllable(playeridtrue);
                            new 
boneFloatOffsetXFloatOffsetYFloatOffsetZFloatRotXFloatRotYFloatRotZFloatScaleXFloatScaleYFloatScaleZ;
                            
format(stringsizeof(string), "UniqueIDs/ID_%06d.ini"PlayerInfo[playerid][pUniqueID]);
                            new 
slot[6];
                            for(new 
iMAX_PLAYER_ATTACHED_ACCSSORIES+PlayerInfo[playerid][pDonator]+1i++)
                            {
                                new 
key[3];
                                
format(keysizeof(key), "S%d"i+1);
                                
slot[i] = DOF2_GetInt(stringkey"Attachments");
                                if(
slot[i] != -255)
                                {
                                    if(
Inventory[playerid][slot[i]] < 0)
                                    {
                                        
format(keysizeof(key), "A%d"i+1);
                                        new 
sstring[90];
                                        
DOF2_GetStringEx(stringkeysstringsizeof(sstring), "Attachments");
                                        
sscanf(sstring"ifffffffff",boneOffsetXOffsetYOffsetZRotXRotYRotZScaleXScaleYScaleZ);
                                        
SetPlayerAttachedObject(playeridi+1, -Inventory[playerid][slot[i]]-9700000boneOffsetXOffsetYOffsetZRotXRotYRotZScaleXScaleYScaleZ);
                                    }
                                    else
                                    {
                                        
DOF2_SetInt(stringkey, -255"Attachments");
                                        
DOF2_SaveFile();
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        
SendClientMessage(playeridCOLOR_RED"ERROR: You must wait between each action.");
                    }
                } 
That's what I can give for now, for I still need your replies on what information do you still need. The bug here is that when the player shapeshifts to a werewolf, it works alright. But, when the werewolf shapeshifts back to a human, the werewolf name stays, leaving the old name. Also, the player's skin will change to a skin of another online player. For example, his previous skin was a cop, but when he turns back to human, the previous cop skin won't come back, but his current skin is now another online player's skin.


Re: Generating a Wolf Name [BUGGED] - PrO.GameR - 31.08.2016

No, we are not planning to help you fix the leaked script, at least thats what I can say for non rep-hunters.
Start one from scratch and we will.


Re: Generating a Wolf Name [BUGGED] - NealPeteros - 31.08.2016

It's fixed. BTW, it's not a leaked script. It really hurts me if you say that it's a leaked script, after all my hardwork making that for 4 weeks. Anyways, thanks for your time.


Re: Generating a Wolf Name [BUGGED] - PrO.GameR - 31.08.2016

Yeah of course cuz anyone other than Rudy uses outdated DOF2 saving system or EXTERIOR as the invalid define, SURE SURE.
Do not assume we are some dumb apes like you.


Re: Generating a Wolf Name [BUGGED] - NealPeteros - 31.08.2016

I don't want to argue with you, alright? Just want to create peace. Now, I'll tell you that your correct, if that makes you feel better. Good now? Peace!