ZCMD wont recognize command
#2

pawn Код:
CMD:pvp(playerid, params[])
{
    new pID, money;
    if(sscanf(params, "ui", pID, money)) return SendClientMessage(playerid, -1, "{FF1E40}[FunZoneLT]>> {FFFFFF}/PVP [Юaidejo nick/ID] [Suma]");
    if(!IsPlayerConnected(pID) || pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Player is not connected.");
    if(GetPlayerMoney(playerid) < money || !money) return SendClientMessage(playerid, -1, "{FF1E40}[FunZoneLT]>> {FFFFFF}Jыs neturite tiek pinigш!");
    if(GetPVarInt(playerid, "pvpmode") == 1) return SendClientMessage(playerid, -1, "{FF1E40}[FunZoneLT]>> {FFFFFF}Jыs dabar esate PVP kovoje!");
    new String[110], kID[MAX_PLAYER_NAME];
    GetPlayerName(playerid, kID, sizeof(kID));
    format(String, sizeof(String), "{FF1E40}[FunZoneLT]>> {FFFFFF}%s jus kvieиia PVP kovai, suma {00FF00}%i $.", kID, money);
    SendClientMessage(pID, -1, String);
    format(String, sizeof(String), "Norint sutikti raрykite {FF1E40}/psutikti %i", playerid);
    SendClientMessage(pID, -1, String);
    format(String, sizeof(String), "{FF1E40}[FunZoneLT]>> {FFFFFF}Norint atsisakyti raрykite {FF0000}/patsaukti %i", playerid);
    SendClientMessage(pID, -1, String);

    //Vars
    pvpinfo[playerid][ITP] = 1;
    pvpinfo[pID][Invited] = 1;
    pvpinfo[playerid][invID] = pID;
    SetPVarInt(playerid, "wmoney", money);
    SetPVarInt(pID, "wmoney", money);
    return 1;
}
It's possible that you were getting an 'array out of bounds' error from this command, causing it to not function properly. Install the crashdetect plugin for future reference on these sorts of strange occurrences. pID was probably an INVALID_PLAYER_ID (65535) or because you were using an array size of [7] for 'money' for some reason... if the player's ID was greater than 6, it would have also crashed the command/server when you tried to access 'money[playerid]'.
Reply


Messages In This Thread
ZCMD wont recognize command - by Type-R - 22.12.2014, 21:24
Re: ZCMD wont recognize command - by Threshold - 23.12.2014, 02:20
Re: ZCMD wont recognize command - by Type-R - 23.12.2014, 18:22
Re: ZCMD wont recognize command - by Threshold - 23.12.2014, 23:35
Re: ZCMD wont recognize command - by Type-R - 24.12.2014, 01:16
Re: ZCMD wont recognize command - by Threshold - 24.12.2014, 09:01
Re: ZCMD wont recognize command - by Type-R - 24.12.2014, 18:00
Re: ZCMD wont recognize command - by Type-R - 25.12.2014, 21:41
Re: ZCMD wont recognize command - by Ryz - 26.12.2014, 03:26

Forum Jump:


Users browsing this thread: 2 Guest(s)