Jump to content
  • 0

Question

Posted

Problema intalnita (descriere): Niste erori, nu stiu cum sa le rezolv.
Ero(area / rile) / warning-(ul / urile):C:\Users\Warr007\Desktop\BETA Server SA-MP v0.1\gamemodes\bgd.pwn(33458) : error 021: symbol already defined: "cmd_e"
(33577) : error 029: invalid expression, assumed zero
(33577) : warning 215: expression has no effect
(33577) : error 001: expected token: ";", but found "]"
(33577) : error 029: invalid expression, assumed zero
(33577) : fatal error 107: too many error messages on one line

Liniile de cod / sursa / script-ul(obligatoriu):

La linia aia e : if(pInfo[playerid][Adminlevel] < 5) SendClientMessage(playerid, 0xFFFFFFFF, string);

Este o comanda

Spoiler

CMD:requestevent(playerid, params[])
{
    if(activeevent == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}There's already an active event.");
    if(requestingevent[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}You're already requesting an event, cancel it first.");
    new title[50], location[50], description[100], prize, time[50];
    if(sscanf(params, "p<|>s[50]s[50]s[50]s[100]d", title, location, time, description, prize)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Syntax: /requestevent [Title|Location|Time|Description|Prize]");
    if(strlen(title) < 1 || strlen(title) > 50) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Invalid amount of characters in title.");
    if(strlen(location) < 1 || strlen(location) > 50) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Invalid amount of characters in location.");
    if(strlen(time) < 1 || strlen(time) > 50) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Invalid amount of characters in time.");
    if(strlen(description) < 1 || strlen(description) > 100) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Invalid amount of characters in description.");
    if(prize < 1 || prize > 5000000) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Invalid prize amount.");
    new string[300], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    requestingevent[playerid] = 1;
    strmid(requestingtitle[playerid], title, 0, strlen(title));
    strmid(requestinglocation[playerid], location, 0, strlen(location));
    strmid(requestingdescription[playerid], description, 0, strlen(description));
    requestingprize[playerid] = prize;
    strmid(requestingtime[playerid], time, 0, strlen(time));
    if(!IsPlayerAdmin(playerid)) SendClientMessage(playerid, 0xFFFFFFFF, "-------------------------------------------");
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerAdmin(i))
        {
            SendClientMessage(i, 0xFFFFFFFF, "-------------------------------------------");
        }
    }
    format(string, sizeof(string), "{FFFF00}Event %d has been requested, details are below.", playerid);
    if(!IsPlayerAdmin(playerid)) SendClientMessage(playerid, 0xFFFFFFFF, string);
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerAdmin(i))
        {
            SendClientMessage(i, 0xFFFFFFFF, string);
        }
    }
    format(string, sizeof(string), "{FFFF00}Event: %d Title: %s Location: %s Time: %s", playerid, title, location, time);
    if(!IsPlayerAdmin(playerid)) SendClientMessage(playerid, 0xFFFFFFFF, string);
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerAdmin(i))
        {
            SendClientMessage(i, 0xFFFFFFFF, string);
        }
    }
    format(string, sizeof(string), "{FFFF00}Organizer: %s Prize: $%s", name, Comma(prize));
    if(!IsPlayerAdmin(playerid)) SendClientMessage(playerid, 0xFFFFFFFF, string);
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerAdmin(i))
        {
            SendClientMessage(i, 0xFFFFFFFF, string);
        }
    }


    format(string, sizeof(string), "{FFFF00}Description: %s", description);
    if(pInfo[playerid][Adminlevel] < 5) SendClientMessage(playerid, 0xFFFFFFFF, string);
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerAdmin(i))
        {
            SendClientMessage(i, 0xFFFFFFFF, string);
        }
    }
    format(string, sizeof(string), "{FFFF00}Use [/acceptevent %d] to accept this event.", playerid);
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerAdmin(i))
        {
            SendClientMessage(i, 0xFFFFFFFF, string);
        }
    }
    SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Your event is pending approval from an admin, please wait.");
    if(!IsPlayerAdmin(playerid)) SendClientMessage(playerid, 0xFFFFFFFF, "-------------------------------------------");
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerAdmin(i))
        {
            SendClientMessage(i, 0xFFFFFFFF, string);
        }
    }
    return 1;
}
 


Imagini / Video (optional): -
Ati incercat sa rezolvati singur?: Desigur m-am uitat peste script basic, am incercat sa modific cate ceva, dar nu mi-a reusit.

13 answers to this question

Recommended Posts

  • 0
Posted
Acum 47 minute, Warr007 a spus:

Problema intalnita (descriere): Niste erori, nu stiu cum sa le rezolv.
Ero(area / rile) / warning-(ul / urile):C:\Users\Warr007\Desktop\BETA Server SA-MP v0.1\gamemodes\bgd.pwn(33458) : error 021: symbol already defined: "cmd_e"
(33577) : error 029: invalid expression, assumed zero
(33577) : warning 215: expression has no effect
(33577) : error 001: expected token: ";", but found "]"
(33577) : error 029: invalid expression, assumed zero
(33577) : fatal error 107: too many error messages on one line

Liniile de cod / sursa / script-ul(obligatoriu):

La linia aia e : if(pInfo[playerid][Adminlevel] < 5) SendClientMessage(playerid, 0xFFFFFFFF, string);

Este o comanda

  Reafișează conținuturi ascunse

CMD:requestevent(playerid, params[])
{
    if(activeevent == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}There's already an active event.");
    if(requestingevent[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}You're already requesting an event, cancel it first.");
    new title[50], location[50], description[100], prize, time[50];
    if(sscanf(params, "p<|>s[50]s[50]s[50]s[100]d", title, location, time, description, prize)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Syntax: /requestevent [Title|Location|Time|Description|Prize]");
    if(strlen(title) < 1 || strlen(title) > 50) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Invalid amount of characters in title.");
    if(strlen(location) < 1 || strlen(location) > 50) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Invalid amount of characters in location.");
    if(strlen(time) < 1 || strlen(time) > 50) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Invalid amount of characters in time.");
    if(strlen(description) < 1 || strlen(description) > 100) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Invalid amount of characters in description.");
    if(prize < 1 || prize > 5000000) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Invalid prize amount.");
    new string[300], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    requestingevent[playerid] = 1;
    strmid(requestingtitle[playerid], title, 0, strlen(title));
    strmid(requestinglocation[playerid], location, 0, strlen(location));
    strmid(requestingdescription[playerid], description, 0, strlen(description));
    requestingprize[playerid] = prize;
    strmid(requestingtime[playerid], time, 0, strlen(time));
    if(!IsPlayerAdmin(playerid)) SendClientMessage(playerid, 0xFFFFFFFF, "-------------------------------------------");
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerAdmin(i))
        {
            SendClientMessage(i, 0xFFFFFFFF, "-------------------------------------------");
        }
    }
    format(string, sizeof(string), "{FFFF00}Event %d has been requested, details are below.", playerid);
    if(!IsPlayerAdmin(playerid)) SendClientMessage(playerid, 0xFFFFFFFF, string);
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerAdmin(i))
        {
            SendClientMessage(i, 0xFFFFFFFF, string);
        }
    }
    format(string, sizeof(string), "{FFFF00}Event: %d Title: %s Location: %s Time: %s", playerid, title, location, time);
    if(!IsPlayerAdmin(playerid)) SendClientMessage(playerid, 0xFFFFFFFF, string);
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerAdmin(i))
        {
            SendClientMessage(i, 0xFFFFFFFF, string);
        }
    }
    format(string, sizeof(string), "{FFFF00}Organizer: %s Prize: $%s", name, Comma(prize));
    if(!IsPlayerAdmin(playerid)) SendClientMessage(playerid, 0xFFFFFFFF, string);
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerAdmin(i))
        {
            SendClientMessage(i, 0xFFFFFFFF, string);
        }
    }


    format(string, sizeof(string), "{FFFF00}Description: %s", description);
    if(pInfo[playerid][Adminlevel] < 5) SendClientMessage(playerid, 0xFFFFFFFF, string);
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerAdmin(i))
        {
            SendClientMessage(i, 0xFFFFFFFF, string);
        }
    }
    format(string, sizeof(string), "{FFFF00}Use [/acceptevent %d] to accept this event.", playerid);
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerAdmin(i))
        {
            SendClientMessage(i, 0xFFFFFFFF, string);
        }
    }
    SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Your event is pending approval from an admin, please wait.");
    if(!IsPlayerAdmin(playerid)) SendClientMessage(playerid, 0xFFFFFFFF, "-------------------------------------------");
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerAdmin(i))
        {
            SendClientMessage(i, 0xFFFFFFFF, string);
        }
    }
    return 1;
}
 


Imagini / Video (optional): -
Ati incercat sa rezolvati singur?: Desigur m-am uitat peste script basic, am incercat sa modific cate ceva, dar nu mi-a reusit.

Imi poti da linia 33548 sr putea ca acel cmd_e sa fie deja definit in alta parte dami linia sa am uit peste ea

  • Upvote 1

giphy.gif

  • 0
Posted (edited)
12 hours ago, Extremys said:

Imi poti da linia 33548 sr putea ca acel cmd_e sa fie deja definit in alta parte dami linia sa am uit peste ea

Am rezolvat acel cmd_e.

Mai am doar linie alea  33577:     if(pInfo[playerid][Adminlevel] < 5) SendClientMessage(playerid, 0xFFFFFFFF, string);

Edited by Warr007
  • 0
Posted

if(pInfo[playerid][Adminlevel] < 5)  -> care ar fi problema ? daca ai enum pInfo vezi ca pe la terminarea acestui enum trb sa ai ceva new P_DATA[MAX_PLAYERS][pInfo]; sau new PlayerInfo[MAX_PLAYERS][pInfo]; ceva de genu, sau pAdminlevel s-ar putea sa ai pAdmin sau pAdminLevel

  • 0
Posted
8 minutes ago, iSkull said:

if(pInfo[playerid][Adminlevel] < 5)  -> care ar fi problema ? daca ai enum pInfo vezi ca pe la terminarea acestui enum trb sa ai ceva new P_DATA[MAX_PLAYERS][pInfo]; sau new PlayerInfo[MAX_PLAYERS][pInfo]; ceva de genu, sau pAdminlevel s-ar putea sa ai pAdmin sau pAdminLevel

(33577) : error 029: invalid expression, assumed zero
(33577) : warning 215: expression has no effect
(33577) : error 001: expected token: ";", but found "]"
(33577) : error 029: invalid expression, assumed zero
(33577) : fatal error 107: too many error messages on one line

 

Aceleasi erori am pus pAdminLevel ca asa e, si e la fel.

  • 0
Posted
8 minutes ago, iSkull said:

arata-mi intreaga comanda ce tine de acest cod + intregul enum cu pAdmin si pLevel

CMD:requestevent(playerid, params[])
{
    if(activeevent == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}There's already an active event.");
    if(requestingevent[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}You're already requesting an event, cancel it first.");
    new title[50], location[50], description[100], prize, time[50];
    if(sscanf(params, "p<|>s[50]s[50]s[50]s[100]d", title, location, time, description, prize)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Syntax: /requestevent [Title|Location|Time|Description|Prize]");
    if(strlen(title) < 1 || strlen(title) > 50) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Invalid amount of characters in title.");
    if(strlen(location) < 1 || strlen(location) > 50) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Invalid amount of characters in location.");
    if(strlen(time) < 1 || strlen(time) > 50) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Invalid amount of characters in time.");
    if(strlen(description) < 1 || strlen(description) > 100) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Invalid amount of characters in description.");
    if(prize < 1 || prize > 5000000) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Invalid prize amount.");
    new string[300], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    requestingevent[playerid] = 1;
    strmid(requestingtitle[playerid], title, 0, strlen(title));
    strmid(requestinglocation[playerid], location, 0, strlen(location));
    strmid(requestingdescription[playerid], description, 0, strlen(description));
    requestingprize[playerid] = prize;
    strmid(requestingtime[playerid], time, 0, strlen(time));
    if(!IsPlayerAdmin(playerid)) SendClientMessage(playerid, 0xFFFFFFFF, "-------------------------------------------");
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerAdmin(i))
        {
            SendClientMessage(i, 0xFFFFFFFF, "-------------------------------------------");
        }
    }
    format(string, sizeof(string), "{FFFF00}Event %d has been requested, details are below.", playerid);
    if(!IsPlayerAdmin(playerid)) SendClientMessage(playerid, 0xFFFFFFFF, string);
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerAdmin(i))
        {
            SendClientMessage(i, 0xFFFFFFFF, string);
        }
    }
    format(string, sizeof(string), "{FFFF00}Event: %d Title: %s Location: %s Time: %s", playerid, title, location, time);
    if(!IsPlayerAdmin(playerid)) SendClientMessage(playerid, 0xFFFFFFFF, string);
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerAdmin(i))
        {
            SendClientMessage(i, 0xFFFFFFFF, string);
        }
    }
    format(string, sizeof(string), "{FFFF00}Organizer: %s Prize: $%s", name, Comma(prize));
    if(!IsPlayerAdmin(playerid)) SendClientMessage(playerid, 0xFFFFFFFF, string);
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerAdmin(i))
        {
            SendClientMessage(i, 0xFFFFFFFF, string);
        }
    }


    format(string, sizeof(string), "{FFFF00}Description: %s", description);
   AICI E LINIA 33577 if(pInfo[playerid][pAdminLevel] < 5) SendClientMessage(playerid, 0xFFFFFFFF, string);
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerAdmin(i))
        {
            SendClientMessage(i, 0xFFFFFFFF, string);
        }
    }
    format(string, sizeof(string), "{FFFF00}Use [/acceptevent %d] to accept this event.", playerid);
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerAdmin(i))
        {
            SendClientMessage(i, 0xFFFFFFFF, string);
        }
    }
    SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Your event is pending approval from an admin, please wait.");
    if(!IsPlayerAdmin(playerid)) SendClientMessage(playerid, 0xFFFFFFFF, "-------------------------------------------");
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerAdmin(i))
        {
            SendClientMessage(i, 0xFFFFFFFF, string);
        }
    }
    return 1;
}

 

  • 0
Posted
8 minutes ago, iSkull said:

arata-mi si enumul pInfo, cel care are pAdmin, pLevel, pCash 

Nu am enum pInfo nici enum pCash nici enum pLevel nici enum pAdmin.

  • 0
Posted
Spoiler

enum playervEnum {
    Float: pHealth,
    Float: pArmour,
    Float: pPos[3],
    Float: specPos[3],
    pPassword[129],
    pStatus,
    pRPoints,
    pMoney, -> Aici cred ca e pCash
    pAdminLevel, -> Aici e pAdmin
    pManager,
    pCrimeReason[200],
    pAdminName[200],
    ReportText[128],
    ActiveReport,
    pInterior,
    pLevel, -> Aici e pLevel
    pInsurancePoints,
    pInsurancePoints2,
    pInsurancePoints3,
    pInsurancePoints4,
    pInsurance,
    pInsurance2,
    pInsurance3,
    pInsurance4,
    pTRoute,
    HoldingObject,
    pTrash,
    pFirstPerson,
    pCarSelected,
    pPDuty,
    pNMuted,
    pFarmerMoney,
    pRMuted,
    pNob[128],
    pHouse,
    pBusiness,
    pGlasses,
    ShowHealth,
    pClanTagType,
    pHelpedPlayers,
    pGiftHours,
    pHelperTokens,
    pHouseKey,
    pBusinessKey,
    pRob,
    pAplicationID,
    pAdminDuty,
    pAge,
    pSkinSet,
    pCall,
    pCarID1,
    pCarID2,
    pCarID3,
    pPiz,
    pAnticheatExemption,
    pTabbed,
    pPremiumPoints,
    pCarWeapons,
    pSpawnChange,
    pWarScore,
    pFWarns,
    pFPunish,
    pCarLicensePlate[32],
    pCarLicensePlate2[32],
    pCarLicensePlate3[32],
    pCarLicensePlate4[32],
    pCarKM,
    pCarKM2,
    pCarKM3,
    pCarKM4,
    pDrugs,
    pPhoneCredit, // Will be done in seconds.
    pWalkieTalkie, // -1 = no walkie, 0 = switched off
    pSpectating,
    pSpecSession,
    pConnectedSeconds,
    pSpamCount,
    pFishing,
    pPhone,
    pMuted,
    pVirtualWorld,
    pFish,
    pFishValue,
    pBanned,
    pTazer,
    pEvent,
    Float: pCarPos1[4],
    Float: pCarPos2[4],
    Float: pCarPos3[4],
    Float: pCarPos4[4],
    pReport,
    pPrisonTime,
    pPrisonID, // 3 = IN CHARACTER JAIL! (future reference)
    pHackWarnTime,
    pHelperDuty,
    pReportMessage[64],
    pPlayingHours,
    pSkin,
    pJob,
    pDriveLicense,
    pGunLicense,
    pBoatLicense,
    pFlyLicense,
    pAccent[40],
    pCarLic,
    pFlyLic,
    pGunLic,
    pPhoneNumber,
    ReportingPlayer,
    pSkinCount,
    pSeeOOC,
    pOOCMuted,
    pNewbieTimeout,
    pTutorial,
    pWeapons[13],
    pOutstandingWeaponRemovalSlot,
    pJetpack,
    pBankMoney,
    pHackWarnings,
    pEmail[255], // because this is the max length for a valid email.
    pSeconds,
    pFightStyle,
    pInternalID,
    pRespect,
    pGender,
    pNewbieEnabled,
    pSpeaker,
    pFirstLogin,
    pRobPoints,
    pHelper,
    pCarColour1[2],
    pCarColour2[2],
    pCarColour3[2],
    pCarColour4[2],
    pMatrunTime,
    pNormalName[MAX_PLAYER_NAME],
    pSelected[MAX_PLAYER_NAME],
    pReason[MAX_PLAYER_NAME],
    pReported,
    pReportAccepted,
    pReportAccepted2,
    pFP,
    pPhoneBook,
    pCheckpoint,
    pPMStatus,
    pOnRequest,
    Text3D: pAFKLabel,
    pGroup,
    pClan,
    pClanRank,
    pCarModel1,
    pCarModel2,
    pCarModel3,
    pCarModel4,
    pCarID4,
    pCarMods1[13],
    pCarMods2[13],
    pCarMods3[13],
    pCarMods4[13],
    pCarPaintjob,
    pCarPaintjob3,
    pCarPaintjob4,
    pCarLock,
    pWarns,
    pCarPaintjob2,
    pCarLock2,
    pCarLock3,
    pCarLock4,
    pGroupRank,
    pDropCarTimeout,
    pMaterials,
    pHeadValue,
    pDonate,
    pHospitalized,
    pFreezeTime,
    pFreezeType,
    pDrag,
    pAnimation,
    pPhoneStatus,
    pPhoneCall,
    pConnectionIP[32],
    pSeeWhisper,
    pCrimes,
    pArrests,
    pWarrants,
    pBackup,
    pPcarkey,
    pHouseRented,
    pWarDeaths,
    pInvite[MAX_PLAYER_NAME],
    pLastLogin[20],
    pColor,
    pDD,
    pDs,
    pDr,
    pSQLID,
       pPCday,
     pPCmonth,
     pPCyear,
     pPcarkey3,
     pPcarkey4,
     pDonateRank,
     pFpunish,
     pCar4Days,
     pCar3Days,
     pCar2Days,
     pCar1Days,
}

 

  • 0
Posted

La linia in care ai probleme treci asa:

if(playerVariables[playerid][pAdminLevel] < 5) nu are ce cauta pInfo, e gm bugged v3.3.0 crek sa unu asemanator cu el, mereu la acest gm e playerVariables

  • Upvote 1
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.