ZCMD not working.
#1

C:\Users\Cristian\Downloads\samp03e_svr_R2_win32\p awno\swag.pwn(2292) : error 029: invalid expression, assumed zero
C:\Users\Cristian\Downloads\samp03e_svr_R2_win32\p awno\swag.pwn(2292) : error 017: undefined symbol "cmd_cell"
C:\Users\Cristian\Downloads\samp03e_svr_R2_win32\p awno\swag.pwn(2292) : error 029: invalid expression, assumed zero
C:\Users\Cristian\Downloads\samp03e_svr_R2_win32\p awno\swag.pwn(2292) : fatal error 107: too many error messages on one line


pawn Код:
COMMAND:cell(playerid, params[])
    {
    if(PlayerData[playerid][LSPDRank] < 2)
    {
    new
    targetid, // the player we want to give money t
    name[MAX_PLAYER_NAME],
    othername[MAX_PLAYER_NAME],
    time;
    if (!sscanf(params, "ii", params))
    {
    if (targetid != INVALID_PLAYER_ID)
    {
    if(PlayerData[playerid][Duty] >= 2)
    {
    new
    message[128], info[128];
    SetPlayerPos(targetid, 264.6347,86.6351,1001.0391);
    SetPlayerInterior(targetid, 6);
    GetPlayerName(playerid, name, sizeof(name));
    GetPlayerName(targetid, othername, sizeof(othername));
    format(message, sizeof(message), "[LSPD] Police Cadet %s has jailed %s for #d minutes.", name, othername, time);
    SendClientMessageToAll(GRAY, message);
    format(info, sizeof(info), "[LSPD] Your weapons and items have been taken away by Police Cadet %s", name);
    SendClientMessage(targetid, GRAY, info);
    }
    else SendClientMessage(playerid, GRAY, "You're not on police duty !");
    }
    else SendClientMessage(playerid, GRAY, "This player is not connected !");
    }
    else SendClientMessage(playerid, GRAY, "Function : /cell [ id ] [ minutes ] !");
    }
    else SendClientMessage(playerid, GRAY, "You must be an Academy Cadet / Agent In Training or higher to use this command !");
    return 1;
    }
Can someone tell me what's wrong ? I installed sscanf version 2.6 and ZCMD and included it at top of the script.

The command is scripted at the bottom.

Line : COMMAND:cell(playerid, params[])
Reply
#2

pawn Код:
CMD:cell(playerid, params[])
{
    if(PlayerData[playerid][LSPDRank] < 2)
    {
        new targetid, name[MAX_PLAYER_NAME], othername[MAX_PLAYER_NAME], time;
        if(sscanf(params, "ii", params)) return SendClientMessage(playerid, GRAY, "Function : /cell [ id ] [ minutes ] !");
        if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, GRAY, "This player is not connected !");
        if(PlayerData[playerid][Duty] >= 2)
        {
            new message[128], info[128];
            SetPlayerPos(targetid, 264.6347,86.6351,1001.0391);
            SetPlayerInterior(targetid, 6);
            GetPlayerName(playerid, name, sizeof(name));
            GetPlayerName(targetid, othername, sizeof(othername));
            format(message, sizeof(message), "[LSPD] Police Cadet %s has jailed %s for #d minutes.", name, othername, time);
            SendClientMessageToAll(GRAY, message);
            format(info, sizeof(info), "[LSPD] Your weapons and items have been taken away by Police Cadet %s", name);
            SendClientMessage(targetid, GRAY, info);
        }
        else SendClientMessage(playerid, GRAY, "You're not on police duty !");
    }
    else SendClientMessage(playerid, GRAY, "You must be an Academy Cadet / Agent In Training or higher to use this command !");
    return 1;
}
Did you tried like this. I know you have ZCMD included but download it again and put it into includes folder in your pawno folder.
Reply
#3

Show the previous few lines. You missed a bracket.
Reply
#4

pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{

    COMMAND:cell(playerid, params[])
    {
    new
    targetid, // the player we want to give money t
    name[MAX_PLAYER_NAME],
    othername[MAX_PLAYER_NAME],
    time;
    if(!sscanf(params, "ii", targetid, time))
    {
    if(PlayerData[playerid][Duty] == 1)
    {
    if (IsPlayerInRangeOfPoint(playerid, 4.0,268.5597,86.9753,1001.0391))
    {
    if(PlayerData[playerid][LSPDRank] < 2)
    {
    new
    message[128], info[128];
    SetPlayerPos(targetid, 264.6347,86.6351,1001.0391);
    SetPlayerInterior(targetid, 6);
    GetPlayerName(playerid, name, sizeof(name));
    GetPlayerName(targetid, othername, sizeof(othername));
    format(message, sizeof(message), "[LSPD] Police Cadet %s has jailed %s for #d minutes.", name, othername, time);
    SendClientMessageToAll(GRAY, message);
    format(info, sizeof(info), "[LSPD] Your weapons and items have been taken away by Police Cadet %s", name);
    SendClientMessage(targetid, GRAY, info);
    Jailed[targetid] = 1;
    JailTimer[targetid] = SetTimerEx("Unjailed",time*60000, false, "i", targetid);//jail timer
    ResetPlayerWeapons(targetid);
    }
    else SendClientMessage(playerid, GRAY, "You must be an Academy Cadet / Agent In Training or higher to use this command !");
    }
    else SendClientMessage(playerid, GRAY, "You're not at the LSPD cells !");
    }
    else SendClientMessage(playerid, GRAY, "You're not on police duty !");
    }
    else SendClientMessage(playerid, GRAY, "Function : /cell [ id ] [ minutes ]");
    return 1;
    }


    COMMAND:olspd(playerid, params[])
    {
    new name[MAX_PLAYER_NAME];
    if (IsPlayerInRangeOfPoint(playerid, 5.0,246.3490,71.5617,1003.6406) && GetPlayerInterior(playerid) == 6)
    {
    if(PlayerData[playerid][LSPDRank] < 2)
    {
    new
    message[128], message2[128];
    GetPlayerName(playerid, name, sizeof(name));
    format(message, sizeof(message), "%s approaches the wall as he inserts a code in the panel.", name);
    ProxDetector(40.0, playerid, message, PURPLE, PURPLE, PURPLE, PURPLE, PURPLE);
    format(message2, sizeof(message2), "The door has been unlocked and opened. [ %s ]", name);
    ProxDetector(40.0, playerid, message2, PURPLE, PURPLE, PURPLE, PURPLE, PURPLE);
    MoveObject(lspddoor, 247.20001220703, 72.599998474121, 1004.4000244141, 2);
    }
    else SendClientMessage(playerid, GRAY, "You must be a Trainee / Agent Trainee or higher to use this command !");
    }
    else SendClientMessage(playerid, GRAY, "You're too far away from the police station entrance !");
    return 1;
    }

    COMMAND:clspd(playerid, params[])
    {
    new name[MAX_PLAYER_NAME];
    if (IsPlayerInRangeOfPoint(playerid, 5.0,246.3490,71.5617,1003.6406) && GetPlayerInterior(playerid) == 6)
    {
    if(PlayerData[playerid][LSPDRank] < 2)
    {
    new
    message[128], message2[128];
    GetPlayerName(playerid, name, sizeof(name));
    format(message, sizeof(message), "%s approaches the wall as he inserts a code in the panel.", name);
    ProxDetector(40.0, playerid, message, PURPLE, PURPLE, PURPLE, PURPLE, PURPLE);
    format(message2, sizeof(message2), "The door has been locked and closed. [ %s ]", name);
    ProxDetector(40.0, playerid, message2, PURPLE, PURPLE, PURPLE, PURPLE, PURPLE);
    MoveObject(lspddoor, 245.60000610352, 72.400001525879, 1004.200012207, 2);
    }
    else SendClientMessage(playerid, GRAY, "You must be a Trainee / Agent Trainee or higher to use this command !");
    }
    else SendClientMessage(playerid, GRAY, "You're too far away from the police station entrance !");
    return 1;
    }

    COMMAND:olspdd(playerid, params[])
    {
    new name[MAX_PLAYER_NAME];
    if (IsPlayerInRangeOfPoint(playerid, 5.0,258.2023,90.8493,1002.4453) && GetPlayerInterior(playerid) == 6)
    {
    if(PlayerData[playerid][LSPDRank] < 2)
    {
    new
    message[128], message2[128];
    GetPlayerName(playerid, name, sizeof(name));
    format(message, sizeof(message), "%s pulls the door by the handle as he inserts a key inside it.", name);
    ProxDetector(40.0, playerid, message, PURPLE, PURPLE, PURPLE, PURPLE, PURPLE);
    format(message2, sizeof(message2), "The door has been unlocked and opened. [ %s ]", name);
    ProxDetector(40.0, playerid, message2, PURPLE, PURPLE, PURPLE, PURPLE, PURPLE);
    MoveObject(lspddoor2, 259.60000610352, 89.400001525879, 1001.200012207, 2);
    }
    else SendClientMessage(playerid, GRAY, "You must be a Trainee / Agent Trainee or higher to use this command !");
    }
    else SendClientMessage(playerid, GRAY, "You're too far away from the cell door !");
    return 1;
    }

    COMMAND:clspdd(playerid, params[])
    {
    new name[MAX_PLAYER_NAME];
    if (IsPlayerInRangeOfPoint(playerid, 5.0,258.2023,90.8493,1002.4453) && GetPlayerInterior(playerid) == 6)
    {
    if(PlayerData[playerid][LSPDRank] < 2)
    {
    new
    message[128], message2[128];
    GetPlayerName(playerid, name, sizeof(name));
    format(message, sizeof(message), "%s pulls the door by the handle as he inserts a key inside it.", name);
    ProxDetector(40.0, playerid, message, PURPLE, PURPLE, PURPLE, PURPLE, PURPLE);
    format(message2, sizeof(message2), "The door has been locked and closed. [ %s ]", name);
    ProxDetector(40.0, playerid, message2, PURPLE, PURPLE, PURPLE, PURPLE, PURPLE);
    MoveObject(lspddoor2, 259.20001220703, 91.599998474121, 1001.4000244141, 2);
    }
    else SendClientMessage(playerid, GRAY, "You must be a Trainee / Agent Trainee or higher to use this command !");
    }
    else SendClientMessage(playerid, GRAY, "You're too far away from the cell door !");
    return 1;
    }


    COMMAND:ogate2(playerid, params[])
    {
    new name[MAX_PLAYER_NAME];
    if (IsPlayerInRangeOfPoint(playerid, 30.0,1588.1656,-1638.7064,13.3459) && GetPlayerInterior(playerid) == 0)
    {
    if(PlayerData[playerid][LSPDRank] < 2)
    {
    new
    message[128], message2[128];
    GetPlayerName(playerid, name, sizeof(name));
    format(message, sizeof(message), "%s uses a remote control to open the gates.", name);
    ProxDetector(40.0, playerid, message, PURPLE, PURPLE, PURPLE, PURPLE, PURPLE);
    format(message2, sizeof(message2), "The gate is moving and opening... [ %s ]", name);
    ProxDetector(40.0, playerid, message2, PURPLE, PURPLE, PURPLE, PURPLE, PURPLE);
    MoveObject(lspdgate2, 1544.7998046875, -1630.7998046875, 13.300000190735,2,-450,0, 0);
    }
    else SendClientMessage(playerid, GRAY, "You must be a Trainee / Agent Trainee or higher to use this command !");
    }
    else SendClientMessage(playerid, GRAY, "You're too far away from the gates !");
    return 1;
    }

    COMMAND:cgate2(playerid, params[])
    {
    new name[MAX_PLAYER_NAME];
    if (IsPlayerInRangeOfPoint(playerid, 30.0,1588.1656,-1638.7064,13.3459) && GetPlayerInterior(playerid) == 0)
    {
    if(PlayerData[playerid][LSPDRank] < 2)
    {
    new
    message[128], message2[128];
    GetPlayerName(playerid, name, sizeof(name));
    format(message, sizeof(message), "%s uses a remote control to close the gates.", name);
    ProxDetector(40.0, playerid, message, PURPLE, PURPLE, PURPLE, PURPLE, PURPLE);
    format(message2, sizeof(message2), "The gate starts moving and closing... [ %s ]", name);
    ProxDetector(40.0, playerid, message2, PURPLE, PURPLE, PURPLE, PURPLE, PURPLE);
    MoveObject(lspdgate2, 1588.5, -1638, 14.60000038147, 2);
    }
    else SendClientMessage(playerid, GRAY, "You must be a Trainee / Agent Trainee or higher to use this command !");
    }
    else SendClientMessage(playerid, GRAY, "You're too far away from the gates !");
    return 1;
    }



    COMMAND:ogate(playerid, params[])
    {
    new name[MAX_PLAYER_NAME];
    if (IsPlayerInRangeOfPoint(playerid, 30.0,1544.6503,-1627.3833,13.3828) && GetPlayerInterior(playerid) == 0)
    {
    if(PlayerData[playerid][LSPDRank] < 2)
    {
    new
    message[128], message2[128];
    GetPlayerName(playerid, name, sizeof(name));
    format(message, sizeof(message), "%s uses a remote control to open the gates.", name);
    ProxDetector(40.0, playerid, message, PURPLE, PURPLE, PURPLE, PURPLE, PURPLE);
    format(message2, sizeof(message2), "The gate is moving and opening... [ %s ]", name);
    ProxDetector(40.0, playerid, message2, PURPLE, PURPLE, PURPLE, PURPLE, PURPLE);
    MoveObject(lspdgate, 1588.5, -1638, 18.60000045147, 2);
    }
    else SendClientMessage(playerid, GRAY, "You must be a Trainee / Agent Trainee or higher to use this command !");
    }
    else SendClientMessage(playerid, GRAY, "You're too far away from the gates !");
    return 1;
    }

    COMMAND:cgate(playerid, params[])
    {
    new name[MAX_PLAYER_NAME];
    if (IsPlayerInRangeOfPoint(playerid, 30.0,1544.6503,-1627.3833,13.3828) && GetPlayerInterior(playerid) == 0)
    {
    if(PlayerData[playerid][LSPDRank] < 2)
    {
    new
    message[128], message2[128];
    GetPlayerName(playerid, name, sizeof(name));
    format(message, sizeof(message), "%s uses a remote control to close the gates.", name);
    ProxDetector(40.0, playerid, message, PURPLE, PURPLE, PURPLE, PURPLE, PURPLE);
    format(message2, sizeof(message2), "The gate starts moving and closing... [ %s ]", name);
    ProxDetector(40.0, playerid, message2, PURPLE, PURPLE, PURPLE, PURPLE, PURPLE);
    MoveObject(lspdgate, 1588.5, -1638, 14.60000038147, 2);
    }
    else SendClientMessage(playerid, GRAY, "You must be a Trainee / Agent Trainee or higher to use this command !");
    }
    else SendClientMessage(playerid, GRAY, "You're too far away from the gates !");
    return 1;
    }
   
    return 1;
    }
I don't see anything wrong.
Reply
#5

Zcmd doesen't go under a callback.
Reply
#6

Quote:
Originally Posted by tyler12
Посмотреть сообщение
Zcmd doesen't go under a callback.
Check it
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)