zcmd 0.3e causes crash
#1

Is it really zcmd causing these crashes? It happens right after using a zcmd command like this one, worked fine on 0.3d

pawn Код:
COMMAND:agivegun(playerid, params[])
{
    printf("[ %s ] /agivegun",GetPlayerNameEx(playerid));
    if(PlayerInfo[playerid][pAdministrator] >= 3)
    {
       
        new iPlayerID,
            iWeapon,
            iAmmo;
       
        if(sscanf(params, "uii", iPlayerID, iWeapon, iAmmo))
        {
            SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /agivegun <PlayerID/PartOfName> <WeaponID> <Ammo>");
            SendClientMessage(playerid, COLOR_WHITE, "3(Club) | 4(knife) | 5(bat) | 6(Shovel) | 7(Cue) | 8(Katana) | 10-13(Dildo) | 14(Flowers)");
            SendClientMessage(playerid, COLOR_WHITE, "16(Grenades) | 18(Molotovs) | 22(Pistol) | 23(SPistol) 24(Eagle) | 25(Shotgun) | 27(SPAS12)");
            SendClientMessage(playerid, COLOR_WHITE, "29(MP5) | 30(AK47) | 31(M4) | 33(Rifle) | 34(Sniper) | 35(Bazooka) | 37(Flamethrower)");
            SendClientMessage(playerid, COLOR_WHITE, "41(Spray) | 42(Fire Extinguisher) | 43(Camera) | 46(Parachute)");
       
            return 1;
        }
       
        if(!IsPlayerConnected(iPlayerID)) return SendErrorMessage(playerid, "ERROR: That playerid is not connected");
   
        if(iWeapon < 1 || iWeapon > 46)
        {
            return SendErrorMessage(playerid, "WeaponID cannot be less than 1 or above 46");
        }
   
        if(iAmmo < 1 || iAmmo > 1500)
        {
            return SendErrorMessage(playerid, "Ammo cannot be above 1500");
        }
       
        if(PlayerInfo[iPlayerID][pLevel] == 1)
        {
            return SendErrorMessage(playerid, "Player has to be above level 1");
        }
   
        ///////////////Execution//////////////////////
        SafeGivePlayerWeapon(iPlayerID, iWeapon, iAmmo);
       
        //////////////Messages////////////////////////
        new szMessage[67+MAX_PLAYER_NAME+2+4+MAX_PLAYER_NAME+2+2+4],
            iYear,
            iMonth,
            iDate;
        //////////////////////Player/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        format(szMessage, 46+MAX_PLAYER_NAME+2+4,"[ADMIN] %s just gave you a weapon [%d] with %d ammo", GetPlayerNameEx(playerid), iWeapon, iAmmo);
        SendClientMessage(iPlayerID, COLOR_YELLOW, szMessage);
        ///////////////////////Admin/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        format(szMessage, 46+MAX_PLAYER_NAME+2+4,"[ADMIN] You just gave %s a weapon [%d] with %d ammo", GetPlayerNameEx(iPlayerID), iWeapon, iAmmo);
        SendClientMessage(playerid, COLOR_YELLOW, szMessage);
        ////////////////////////////////////////////////////////////Logging//////////////////////////////////////////////////////////////////////////
        getdate(iYear, iMonth, iDate);
        format(szMessage, 67+MAX_PLAYER_NAME+2+4+MAX_PLAYER_NAME+2+2+4,"[/agivegun] %s was just given a [%d] with %d ammo by administrator %s [%d/%d/%d]", GetPlayerNameEx(iPlayerID), iWeapon, iAmmo, GetPlayerNameEx(playerid), iDate, iMonth, iYear);
        AbuseLog(szMessage);
    }
    return 1;
}
Reply
#2

If yes, do I just need to switch to any other processor or is there a fix?
Reply
#3

No its not zcmd
there is something wrong in your code.
Reply
#4

So a bug flies in right after upgrading to 0.3e
Thanks Romel for your answer I will dig into it and find out whats wrong
Reply
#5

Well try using YCMD and check.
Reply
#6

Well try using YCMD and check.
Edit: im sorry for spam it happened because of internet crash. Im sorry
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)