SA-MP Forums Archive
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)
+--- Thread: errors (/showthread.php?tid=581421)



errors - alexanderjb918 - 12.07.2015

Код:
C:\Users\ii\Desktop\New Folder (5)\gamemodes\roleplay.pwn(25726) : warning 217: loose indentation
C:\Users\ii\Desktop\New Folder (5)\gamemodes\roleplay.pwn(25763) : error 006: must be assigned to an array
C:\Users\ii\Desktop\New Folder (5)\gamemodes\roleplay.pwn(25764) : warning 217: loose indentation
C:\Users\ii\Desktop\New Folder (5)\gamemodes\roleplay.pwn(25764) : error 001: expected token: ";", but found ")"
C:\Users\ii\Desktop\New Folder (5)\gamemodes\roleplay.pwn(25764) : error 029: invalid expression, assumed zero
C:\Users\ii\Desktop\New Folder (5)\gamemodes\roleplay.pwn(25764) : warning 215: expression has no effect
C:\Users\ii\Desktop\New Folder (5)\gamemodes\roleplay.pwn(25783) : error 017: undefined symbol "playerid"
C:\Users\ii\Desktop\New Folder (5)\gamemodes\roleplay.pwn(25784) : error 017: undefined symbol "playerid"
C:\Users\ii\Desktop\New Folder (5)\gamemodes\roleplay.pwn(25790) : error 017: undefined symbol "playerid"
C:\Users\ii\Desktop\New Folder (5)\gamemodes\roleplay.pwn(25791) : error 017: undefined symbol "playerid"
Код:
Dialog:ViewPlayer(playerid, response, listitem, inputtext[])
{
        if (GetFactionType(playerid) != FACTION_POLICE || !IsACruiser(GetPlayerVehicleID(playerid)))
            return 0;

        if (response)
        {
                if (isnull(inputtext) || strlen(inputtext) > 24)
                    return Dialog_Show(playerid, ViewPlayer, DIALOG_STYLE_INPUT, "View Information", "Please enter the ID of the player:", "Submit","Back");

                if (IsNumeric(inputtext) && IsPlayerConnected(strval(inputtext))) {
                PlayerData[playerid][pMDCPlayer] = inputtext;
                        ViewPlayer(playerid, PlayerData[playerid][pMDCPlayer]));
                }
                else {
                    Dialog_Show(playerid, ViewPlayer, DIALOG_STYLE_INPUT, "View Information", "Please enter the ID of the player:", "Submit","Back");
                }
        }
        else cmd_mdc(playerid, "\1");
        return 1;
}

forward ViewPlayer(extraid, name[]);
public ViewPlayer(extraid, name[])
{
        if (GetFactionType(extraid) != FACTION_POLICE)
            return 0;
        SendClientMessageEx(extraid, COLOR_WHITE, "------------------------_POLICE DATABASE_----------------------");
        SendClientMessageEx(extraid, COLOR_WHITE, "Logged in as %s", ReturnName(extraid, 1));
        SendClientMessageEx(extraid, COLOR_WHITE, "---------------------------------------------------------------");
        SendClientMessageEx(extraid, COLOR_WHITE, "------------------------_PERSON CHECK_----------------------");
        SendClientMessageEx(extraid, COLOR_WHITE, "Name: %s", ReturnName(PlayerData[playerid][pMDCPlayer], 1));
        for (new i = 0; i < MAX_HOUSES; i ++) if (House_IsOwner(PlayerData[playerid][pMDCPlayer], i)) {
            SendClientMessageEx(extraid, COLOR_WHITE, "Address: %s", HouseData[i][houseAddress]);
        }
        else if (!House_IsOwner(extraid, i)) {
            SendClientMessageEx(extraid, COLOR_WHITE, "Address: None");
        }
        SendClientMessageEx(extraid, COLOR_WHITE, "Date Of Birth: %s", PlayerData[PlayerData[playerid][pMDCPlayer]][pBirthdate]);
        SendClientMessageEx(extraid, COLOR_WHITE, "Phone Number: %s", PlayerData[PlayerData[playerid][pMDCPlayer]][pPhone]);
        SendClientMessageEx(extraid, COLOR_WHITE, "---------------------------------------------------------------");
        return 1;
}



Re: errors - zSuYaNw - 13.07.2015

you can test it.

pawn Код:
forward ViewPlayer(extraid, name[]);
public ViewPlayer(extraid, name[])
{
        if (GetFactionType(extraid) != FACTION_POLICE)
            return 0;
           
           
        SendClientMessageEx(extraid, COLOR_WHITE, "------------------------_POLICE DATABASE_----------------------");
        SendClientMessageEx(extraid, COLOR_WHITE, "Logged in as %s", ReturnName(extraid, 1));
        SendClientMessageEx(extraid, COLOR_WHITE, "---------------------------------------------------------------");
        SendClientMessageEx(extraid, COLOR_WHITE, "------------------------_PERSON CHECK_----------------------");
        SendClientMessageEx(extraid, COLOR_WHITE, "Name: %s", ReturnName(PlayerData[extraid][pMDCPlayer], 1));
       
       
       
        for (new i = 0; i < MAX_HOUSES; i ++){
            if (House_IsOwner(PlayerData[extraid][pMDCPlayer], i))
            {
                SendClientMessageEx(extraid, COLOR_WHITE, "Address: %s", HouseData[i][houseAddress]);
            }
       
            else if (!House_IsOwner(extraid, i))
            {
                SendClientMessageEx(extraid, COLOR_WHITE, "Address: None");
            }
        }
        SendClientMessageEx(extraid, COLOR_WHITE, "Date Of Birth: %s", PlayerData[PlayerData[extraid][pMDCPlayer]][pBirthdate]);
        SendClientMessageEx(extraid, COLOR_WHITE, "Phone Number: %s", PlayerData[PlayerData[extraid][pMDCPlayer]][pPhone]);
        SendClientMessageEx(extraid, COLOR_WHITE, "---------------------------------------------------------------");
        return 1;
}