SA-MP Forums Archive
Is doing this safe or will it cause bugs? - 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: Is doing this safe or will it cause bugs? (/showthread.php?tid=464848)



Is doing this safe or will it cause bugs? - knackworst - 19.09.2013

Hello

I am using an alternative way of class selection, however I'm not sure if it is safe...
So does anyone maybe know if this way of class selecting is a good idea or not?

here's what I do:
pawn Код:
public OnGameModeInit()
{
    AddPlayerClass(1, 0.0,2987.9231,3.1354, 130.3651, 0, 0, 0, 0, 0, 0); //I add one class to avoid bugs
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
   
    SetTimer("RequestTimer", 2222, false);
   
    new file[64],PlayerName[25];
    GetPlayerName(playerid,PlayerName,sizeof PlayerName);
    format(file,sizeof file,"Admin/%s.ini",PlayerName);
    if(!fexist(file) && PInfo[playerid][Logged] == 0)
    {
        Register(playerid);
    }
    if(fexist(file) && PInfo[playerid][Logged] == 0)
    {
        Login(playerid);
    }
   
    SetPlayerPos(playerid,-3074.7300,2987.9231,3.1354);
    SetPlayerFacingAngle(playerid,130.3651);
    InterpolateCameraPos(playerid,-3108.9041,2966.4634,12.2926,-3100.8394,2964.5935,10.7787, 2000, CAMERA_MOVE);
    InterpolateCameraLookAt(playerid,-3100.8394,2964.5935,10.7787, -3068.4573,2987.2256,2.2427 + 3, 2000, CAMERA_MOVE);

    return 1;
}
So basically instead of using the addplayerclass function to set a player skin and pos I use SetPlayerPos and SetPlayerSkin seperately...
Is that ok? or can it lead to problems?
Thanks in advance =)


Re: Is doing this safe or will it cause bugs? - alinategh - 19.09.2013

There is an easy way to find out, Test it


Re: Is doing this safe or will it cause bugs? - knackworst - 19.09.2013

Yes of course it's tested, and it works fine, but if it looks fine it doesn't mean that it actually works flawless...