SA-MP Forums Archive
/sb won't wanna work anymore - 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: /sb won't wanna work anymore (/showthread.php?tid=350156)



/sb won't wanna work anymore - Stefand - 11.06.2012

Hey,

I tried to make it only if someone is in a vehicle.

pawn Код:
command(sb, playerid, params[])
{
        new string[128];
        if(Player[playerid][Seatbelt] == 0)
        if(IsPlayerInAnyVehicle(playerid))
        {
            format(string, sizeof(string), "* %s has buckled up his seatbelt.", GetName(playerid));
            NearByMessage(playerid, NICESKY, string);
            Player[playerid][Seatbelt] = 1;
        }
    }
    else
    }
        if(Player[playerid][Seatbelt] == 1)
        if(IsPlayerInAnyVehicle(playerid))
        {
            format(string, sizeof(string), "* %s has unbuckle his seatbelt.", GetName(playerid));
            NearByMessage(playerid, NICESKY, string);
            Player[playerid][Seatbelt] = 0;
        }
    return 1;
}
and now it give these errors.

pawn Код:
C:\Users\Stefan Dorst\Desktop\Volcom Rp\gamemodes\SRP.pwn(15245) : error 010: invalid function or declaration
C:\Users\Stefan Dorst\Desktop\Volcom Rp\gamemodes\SRP.pwn(15247) : error 010: invalid function or declaration
C:\Users\Stefan Dorst\Desktop\Volcom Rp\gamemodes\SRP.pwn(15248) : error 010: invalid function or declaration
C:\Users\Stefan Dorst\Desktop\Volcom Rp\gamemodes\SRP.pwn(15251) : error 021: symbol already defined: "NearByMessage"
C:\Users\Stefan Dorst\Desktop\Volcom Rp\gamemodes\SRP.pwn(15254) : error 010: invalid function or declaration
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
Also see this topic http://forum.sa-mp.com/showthread.ph...72#post1917672


Re: /sb won't wanna work anymore - JhnzRep - 11.06.2012

Why on Earth, would you post a second topic...

Please, please, please use the EDIT button.


Re: /sb won't wanna work anymore - Stefand - 11.06.2012

Quote:
Originally Posted by JhnzRep
Посмотреть сообщение
Why on Earth, would you post a second topic...

Please, please, please use the EDIT button.
Its not the same, this is about the /sb command itself the other is to put the player back into his vehicle.


Re: /sb won't wanna work anymore - JhnzRep - 11.06.2012

Still, please just edit your post..It's the same topic..


Re: /sb won't wanna work anymore - -CaRRoT - 11.06.2012

Quote:

Dorst\Desktop\Volcom Rp\gamemodes\SRP.pwn(15254) : error 010: invalid function or declaration

Show which line is this..

- And You defined "NearByMessage" two times in your script.. It's not hard to read the error tho.


Re: /sb won't wanna work anymore - cosbraa - 11.06.2012

pawn Код:
command(sb, playerid, params[])
{
    new string[128];
    if(Player[playerid][Seatbelt] == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            format(string, sizeof(string), "* %s has buckled up his seatbelt.", GetName(playerid));
            NearByMessage(playerid, NICESKY, string);
            Player[playerid][Seatbelt] = 1;
        }
    }
    else if(Player[playerid][Seatbelt] == 1)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            format(string, sizeof(string), "* %s has unbuckle his seatbelt.", GetName(playerid));
            NearByMessage(playerid, NICESKY, string);
            Player[playerid][Seatbelt] = 0;
        }
    }
    return 1;
}



Re: /sb won't wanna work anymore - Mimic - 11.06.2012

pawn Код:
format(string, sizeof(string), "* %s has unbuckled his seatbelt.", GetName(playerid));
Sorry, it just had to be done.