SA-MP Forums Archive
Help, can't fix errors - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help, can't fix errors (/showthread.php?tid=257165)



Help, can't fix errors - cazz21 - 24.05.2011

Could you please help me fix these errors

Here's the script:

http://pastebin.com/yFwtFUsC

Here's the errors:

http://pastebin.com/7XTVm1px

Thanks

Cazz


Re: Help, can't fix errors - cs_master - 24.05.2011

lots of errors man i dont under stand ahhhhhhhhhhhhhhhh and the script is so small XD


Re: Help, can't fix errors - cazz21 - 24.05.2011

I've only just started scripting, a friend gave me a very basic understanding and this is way past my ability at the moment :/ sucks to be me?


Re: Help, can't fix errors - Wesley221 - 24.05.2011

Haha i had the same problem with teams

I've made a new script for you, you can copy paste it, and change the things you want.
There are some little explenations in it; if you need any other information about it: just post here

http://pastebin.com/4zkqudZv

Edit: Forget to say, i didn't test it yet; so just post me the problems if there are any


Re: Help, can't fix errors - cazz21 - 24.05.2011

Thanks I'll give that script a quick test drive


Re: Help, can't fix errors - cazz21 - 24.05.2011

Wow that served as an amazing base script! thank you soo much!


Re: Help, can't fix errors - Wesley221 - 24.05.2011

Youre welcome
If you want class-only cars, then just make a new variable like

pawn Код:
new Class_Car[MAX_CARS];

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new Vehicle = GetPlayerVehicleID(playerid);
        for(new j=0; j < 50; j++)
        {
            if(Vehicle == Class1[j])
            {
                if(gTeam[playerid] == Class1)
                {
                    return 1;
                } else {
                    RemovePlayerFromVehicle(playerid);
                    SendClientMessage(playerid, orange, "Sorry, this car is not for you");
                    return 1;
                }
            }
        }
    }
    return 1;
}



Re: Help, can't fix errors - cazz21 - 24.05.2011

was just about to ask :L


Re: Help, can't fix errors - cazz21 - 24.05.2011

pawn Код:
new Class_Car[MAX_CARS];

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new Vehicle = GetPlayerVehicleID(playerid);
        for(new j=0; j < 50; j++)
        {
            if(Vehicle == Class1[j]) <----- what do i put in there? the Player class?
            {
                if(gTeam[playerid] == Class1)
                {
                    return 1;
                } else {
                    RemovePlayerFromVehicle(playerid);
                    SendClientMessage(playerid, orange, "Sorry, this car is not for you");
                    return 1;
                }
            }
        }
    }
    return 1;
}



Re: Help, can't fix errors - Wesley221 - 24.05.2011

pawn Код:
if(Vehicle == >>put your class in here<<[j])