Wierd bug
#1

Hello I have little bug in my code, what I want to make is /windows system for vehicles to open and close them.. cmd is working on but OnPlayerText isn't working properly, when player has windows opened everything working great but when player have closed windows there is a strange bug, I want to make if windows are closed only people inside car will see the message, but I tested it with my friend and if he was writing I saw message and everything but he didn't saw his text and also not mine :/ what is wrong?

pawn Код:
public OnPlayerText(playerid, text[])
{
    new vehicleid = GetPlayerVehicleID(playerid);
    new Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, sizeof(Name));
    new string[256];
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(!IsPlayerConnected(i)) continue;
        {
            if(IsPlayerInAnyVehicle(i) && !IsModelABike(vehicleid) && !IsModelASpecial(vehicleid))
            {
                if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
                {
                    if(Carinfo[vehicleid][VehWin] == 0) // closed
                    {
                        format(string, sizeof(string), "%s: %s",Name,text);
                        SendClientMessage(i,-1,string);
                        return 0;
                    }
Reply
#2

Код:
public OnPlayerText(playerid, text[])
{
    new vehicleid = GetPlayerVehicleID(playerid);
    new Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, sizeof(Name));
    new string[256];
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(!IsPlayerConnected(i)) continue;
        {
            if(IsPlayerInAnyVehicle(i) && !IsModelABike(vehicleid) && !IsModelASpecial(vehicleid))
            {
I think should be:

Код:
public OnPlayerText(playerid, text[])
{
    new vehicleid = GetPlayerVehicleID(playerid);
    new Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, sizeof(Name));
    new string[256];
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i)) continue;
      
        if(IsPlayerInAnyVehicle(i) && !IsModelABike(vehicleid) && !IsModelASpecial(vehicleid))
        {
No clue if that will fix your bug though.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)